302 const int port = ntohs(sockAddr.sin_port) + 1;
304 SockAddr.sin_family = sockAddr.sin_family;
305 SockAddr.sin_addr = sockAddr.sin_addr;
308 if ((
socket = ::
socket(PF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0)) <= 0)
316 if (setsockopt(
socket, IPPROTO_TCP, TCP_NODELAY, &optval,
sizeof(
int)) < 0)
320 if (setsockopt (
socket, SOL_SOCKET, SO_KEEPALIVE, &optval,
sizeof(
int)) < 0)
324 if (setsockopt (
socket, SOL_TCP, TCP_KEEPIDLE, &optval,
sizeof(
int)) < 0)
328 if (setsockopt (
socket, SOL_TCP, TCP_KEEPINTVL, &optval,
sizeof(
int)) < 0)
332 if (setsockopt (
socket, SOL_TCP, TCP_KEEPCNT, &optval,
sizeof(
int)) < 0)
void factPrintf(int severity, const char *fmt,...)
An info telling something which can be interesting to know.
static uint activeSockets
struct sockaddr_in SockAddr
An error which cannot be handled at all happend, the only solution is program termination.