mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-11 22:17:17 +03:00
close socket when connect() fails
might be linked to "too many CLI connection" but I'm not sure
This commit is contained in:
@@ -279,6 +279,7 @@ static void notify(in_addr_t ip, u16_t hport, u16_t cport) {
|
|||||||
|
|
||||||
if (connect(cli_sock, (struct sockaddr *) &addr, addrlen) < 0) {
|
if (connect(cli_sock, (struct sockaddr *) &addr, addrlen) < 0) {
|
||||||
LOG_ERROR("unable to connect to server %s:%hu with cli", inet_ntoa(server_ip), server_cport);
|
LOG_ERROR("unable to connect to server %s:%hu with cli", inet_ntoa(server_ip), server_cport);
|
||||||
|
closesocket(cli_sock);
|
||||||
cli_sock = -1;
|
cli_sock = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user