Socket error 10038

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Recently compiled server program, often be rather baffling play clothes off clothing and login, error code 10038 (invalid socket), and the socket is created and connected in when the program is started, and did not shut down.

Search the Internet to see this article, immediately understand. http://hi.baidu.com/gensoft/item/716dc9cd59dd817aced4f81b

The reason is the windows socket cannot be shut down many times. While the game take off repeatedly in the client connection socket, resulting in connection with the login server socket is invalid.

Close the socket safety practices:


//To prevent the socket is shut down many times
if(_socket!=INVALID_SOCKET)
{
closesocket(_socket);
_socket = INVALID_SOCKET;
}


To forget.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Edwin at December 19, 2013 - 8:19 AM