Linux: Binds to MY_IP_ADDRESS in client mode (#849)

This commit is contained in:
Marcelo Aquino
2017-05-21 14:27:22 +02:00
committed by Olivier
parent abba1ec377
commit fb3d936d4c
5 changed files with 45 additions and 10 deletions
+5
View File
@@ -51,6 +51,11 @@ void EthernetServer::begin(IPAddress address)
char ipstr[INET_ADDRSTRLEN];
char portstr[6];
if (sockfd != -1) {
close(sockfd);
sockfd = -1;
}
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;