• Advertisement

Archived

This topic is now archived and is closed to further replies.

Small TCP problem

This topic is 5036 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

Hi, I''m making a small simple TCP lobby server. I''ve noticed that when I close a socket after a client unexpectedly disconnects (error 10054), that reconnecting also causes a 10054 error when trying to recieve from that socket. These sockets are non-blocking.

Share this post


Link to post
Share on other sites
Advertisement
Once a socket is has been closed, you have to create a new socket, either for listening or for connecting.

Kuphryn

Share this post


Link to post
Share on other sites
If I change the handle of a closed socket after using accept with my listen socket, would that work, or do I need to open it before setting the handle?

Share this post


Link to post
Share on other sites
Yes, assigning a handle to a closed socket, which in this case is an invalid handle, to a valid socket return from accept API is okay.

Kuphryn

Share this post


Link to post
Share on other sites

  • Advertisement