You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered the following error on inet_stream_server side when I use inet_stream to connect to it with the server's IP address specified (VERBOSE set to 1)
Temporary failure in name resolution
/home/libsocket-2.4.1/C++/inetserverstream.cpp:169: inet_stream_server::accept() - could not accept new connection on stream server socket! (Success)
The reason is the getnameinfo fails when my system does not connect to the Internet. The /etc/resolv.conf on both client and server is nameserver 127.0.0.1
I suggest to handle the case like following. (The patch has not been designed to work when _TRADITIONAL_RDNS is set, though)
diff --git a/C/inet/libinetsocket.c b/C/inet/libinetsocket.c
index 3dbb253..5b0208d 100644
--- a/C/inet/libinetsocket.c
+++ b/C/inet/libinetsocket.c
@@ -774,10 +774,12 @@ int accept_inet_stream_socket(int sfd, char* src_host, size_t src_host_len, char
errstr = gai_strerror(retval);
debug_write(errstr);
# endif
- return -1;
+ /* It is not a fatal error when the DNS is unavailable */
+ if (errno != 0)
+ return -1;
}
# endif
The text was updated successfully, but these errors were encountered:
ducss2015
changed the title
Cannot create socket when no DNS avaiable
Cannot connect to server when no DNS avaiable
Jul 7, 2015
ducss2015
changed the title
Cannot connect to server when no DNS avaiable
Cannot connect to server when no DNS available on server
Jul 7, 2015
ducss2015
changed the title
Cannot connect to server when no DNS available on server
Cannot connect to server when no DNS available
Jul 7, 2015
I encountered the following error on inet_stream_server side when I use inet_stream to connect to it with the server's IP address specified (VERBOSE set to 1)
The reason is the
getnameinfo
fails when my system does not connect to the Internet. The/etc/resolv.conf
on both client and server isnameserver 127.0.0.1
I suggest to handle the case like following. (The patch has not been designed to work when _TRADITIONAL_RDNS is set, though)
The text was updated successfully, but these errors were encountered: