Skip to content

Commit

Permalink
Shutdown sockets before closing
Browse files Browse the repository at this point in the history
The server socket does not release the port it was listening for if we
just close it: we must also shutdown it.
  • Loading branch information
rom1v committed Mar 5, 2018
1 parent 36c68c4 commit ef0029d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static socket_t listen_on_port(Uint16 port) {

static void close_socket(socket_t *socket) {
SDL_assert(*socket != INVALID_SOCKET);
net_shutdown(*socket, SHUT_RDWR);
if (!net_close(*socket)) {
LOGW("Cannot close socket");
return;
Expand Down

0 comments on commit ef0029d

Please sign in to comment.