extern time_t TIME;
extern int openSockfd[MAX_DESCRIPTORS];
-InspSocket* socket_ref[MAX_DESCRIPTORS];
-
/** This will bind a socket to a port. It works for UDP/TCP.
* If a hostname is given to bind to, the function will first
* attempt to resolve the hostname, then bind to the IP the
else
{
/* Associate the new open port with a slot in the socket engine */
- ServerInstance->SE->AddFd(openSockfd[count],true,X_LISTEN);
- BoundPortCount++;
+ if (openSockfd[count] > -1)
+ {
+ ServerInstance->SE->AddFd(openSockfd[count],true,X_LISTEN);
+ BoundPortCount++;
+ }
}
}
return InitialPortCount + BoundPortCount;