From 1caef9a4c2983eefb6a4e296f9a4e28d3c5a4b63 Mon Sep 17 00:00:00 2001 From: Carlos Daniel Ruvalcaba Valenzuela Date: Sat, 15 Sep 2007 15:26:33 -0700 Subject: [PATCH] Added support for INADDR_ANY --- src/posixsocket.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/posixsocket.cpp b/src/posixsocket.cpp index 7904908..8acb736 100644 --- a/src/posixsocket.cpp +++ b/src/posixsocket.cpp @@ -82,7 +82,11 @@ public: } void setAddress(char *addr){ - inet_pton(AF_INET, addr, &(sock_addr->sin_addr)); + if (addr == NULL){ + sock_addr->sin_addr.s_addr = htonl(INADDR_ANY); + }else{ + inet_pton(AF_INET, addr, &(sock_addr->sin_addr)); + } } char *getAddress(){ -- 2.11.4.GIT