top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

I would like to map an ephemeral port to a pid?

+1 vote

I have a RHEL server with several application on it and I am attempting to figure out which one of them is making calls to an external web service. I have TCP dumps that show the calls being made and through various tools I am able to determine what ephemeral port is making those calls. However, I am unable to figure out how to map that ephemeral port to a pid.

Is there any way to map an in-use ephemeral port to a pid or some other indicator as to what file is making the call?

posted Oct 2, 2013 by Vinay Shukla

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
lsof -i $PROTCOL:$PORT
nestat -np | grep $PORT

Any of those should work. Below is sample output showing my mail client using ephemeral port 56375 to talk to an IMAP server.

$ sudo netstat -np | grep 56375
tcp        0      0       ESTABLISHED 3256/thunderbird 
$ fuser 56375/tcp 
56375/tcp:            3256 
$ lsof -i tcp:56375
thunderbi 3256   me     87u  IPv4 510573      0t0  TCP hostname:56375-> (ESTABLISHED)
answer Oct 2, 2013 by Satyabrata Mahapatra
Similar Questions
0 votes

I want to make a TCP server which accepts connection from the configured list of IPs.

+1 vote

As per tomcat's performance tuning doc, 'tcpNoDelay' can be enabled/disabled at connector level.

Is there a programmatic way to set 'tcpNoDelay' to true for web socket connections ? I am using tomcat's proprietary web socket APIs in my application.

I have gone though the API documentation of tomcat's proprietary web socket implementation, I didn't see any API which allows application to override the 'tcpNoDelay' value.

As per doc for "writeTextMessage(CharBuffer msgCb)" of 'WsOutbound', for each write, tomcat flushes the socket buffer and sends the new frame with the buffer passed. Does that mean, flushing of socket buffer gives the same effect of disabling naggle's algorithm ?

+2 votes

We can set bandwidth for UDP while TCP uses its maximum bandwidth...why it is like this?