mirror of https://github.com/Genymobile/scrcpy
Shutdown sockets before closing
The server socket does not release the port it was listening for if we just close it: we must also shutdown it.
This commit is contained in:
parent
db396f2138
commit
acd2dc3183
|
@ -71,6 +71,7 @@ static socket_t listen_on_port(Uint16 port) {
|
||||||
|
|
||||||
static void close_socket(socket_t *socket) {
|
static void close_socket(socket_t *socket) {
|
||||||
SDL_assert(*socket != INVALID_SOCKET);
|
SDL_assert(*socket != INVALID_SOCKET);
|
||||||
|
net_shutdown(*socket, SHUT_RDWR);
|
||||||
if (!net_close(*socket)) {
|
if (!net_close(*socket)) {
|
||||||
LOGW("Cannot close socket");
|
LOGW("Cannot close socket");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue