Do not release TCP sockets while still in use
SDLNet_TCP_Close() not only closes, but also release the resources. Therefore, we must not close the socket if another thread attempts to read it. For that purpose, move socket closing from server_stop() to server_destroy().
This commit is contained in:
@@ -31,4 +31,7 @@ TCPsocket server_connect_to(struct server *server, const char *serial);
|
||||
// disconnect and kill the server process
|
||||
void server_stop(struct server *server, const char *serial);
|
||||
|
||||
// close and release sockets
|
||||
void server_destroy(struct server *server);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user