Jump to content
  • Advertisement
Sign in to follow this  
Kitt3n

leaking sockets?

This topic is 4078 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm still playing around with my iocp framework, currently on the disconnection part. I have a simple loop where a client disconnects and then a few seconds later it reconnects. From the server side, it accepts the connection and I've noticed it each time has a different port. So the server will for example accept the connection from client port 1900, then when the client disconnects and reconnects it gets a connection from 1901 and so on... Does this mean the client couldn't 'reuse' socket 1900 - or is this normal (and will it eventually get used again) ? Is there an app with which I can check all sockets & their status? note: I shutdown the socket with sth like this: LINGER lingerStruct; lingerStruct.l_onoff = 1; lingerStruct.l_linger = 0; setsockopt( socket, SOL_SOCKET, SO_LINGER, (char *)&lingerStruct,s izeof(lingerStruct) ); CancelIo((HANDLE) socket); // had shutdown closesocket( socket); Regards

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Kitt3n
Does this mean the client couldn't 'reuse' socket 1900 - or is this
normal (and will it eventually get used again) ?
Is there an app with which I can check all sockets & their status?
That's normal, the socket will be reused eventually (Someone else should be able to explain why this happens).
You can use the netstat command from the command prompt to see the status of all sockets.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!