When namespacetool commands are run without any delay, the second command
may fail because the previous socket connection was not closed.
--localPort;
continue;
}
+ if (apiErr == SOCKERR_CONNECT && sysErr == SYSERR_ETIMEDOUT) {
+ /*
+ * ETIMEDOUT on connect due to timeout.
+ * Simply try next port.
+ */
+ --localPort;
+ continue;
+ }
if (apiErr == SOCKERR_CONNECT && sysErr == SYSERR_EINTR) {
/*
* EINTR on connect due to signal.
#define SYSERR_EACCESS WSAEACCES
#define SYSERR_EINTR WSAEINTR
#define SYSERR_ECONNRESET WSAECONNRESET
+#define SYSERR_ETIMEDOUT WSAETIMEDOUT
typedef int socklen_t;
#define SYSERR_EACCESS EACCES
#define SYSERR_EINTR EINTR
#define SYSERR_ECONNRESET ECONNRESET
+#define SYSERR_ETIMEDOUT ETIMEDOUT
typedef int SOCKET;
#define SOCKET_ERROR (-1)