-5

I have read other threads regarding sockets in TIME_WAIT, but I am clearly still missing something.

Below is a few lines from a "netstat -an". How could it get into this situation? If I understood the descriptions I found, we should not have more than one instance of the socket 63444 ... but after the one listed as "LISTEN" there are about 50 individual socket connections with one end at 63444, all in "TIME_WAIT". How could this happen, and how can I fix it?

tcp        0      0 0.0.0.0:63444           0.0.0.0:*               LISTEN      
tcp        0      0 169.254.7.228:63444     169.254.66.84:35391     TIME_WAIT   
tcp        0      0 169.254.7.228:63444     169.254.66.84:35283     TIME_WAIT   
tcp        0      0 169.254.7.228:63444     169.254.66.84:35352     TIME_WAIT   
tcp        0      0 169.254.7.228:63444     169.254.66.84:35431     TIME_WAIT
  • This is normal TCP behavior. You have one entry per connection. As you can see, the port on the right is different for every one of them. They are different TCP connections. – yoonix Aug 19 '15 at 22:33
  • 1
    For the same reasons as when you asked this on SO – Eric Renouf Aug 21 '15 at 15:41
3

TCP connections are not identified by just the local port number. They are identified by the tuple consisting of local IP address, local port number, remote IP address, and remote port number.

Since the remote port number differs, they are different connections.

The socket API has one socket per connection plus one listening socket for accepting incoming connections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.