}
#ifdef VCL_TEST
- client_fd = vppcom_session_accept (ssm->listen_fd, &conn->endpt,
+ client_fd = vppcom_session_accept (ssm->listen_fd, &conn->endpt, 0,
-1.0 /* wait forever */ );
if (client_fd < 0)
errno = -client_fd;
+#elif HAVE_ACCEPT4
+ client_fd = accept4 (ssm->listen_fd, (struct sockaddr *) NULL, NULL, NULL);
#else
client_fd = accept (ssm->listen_fd, (struct sockaddr *) NULL, NULL);
#endif
errno_val = errno;
perror ("ERROR in new_client()");
fprintf (stderr, "ERROR: accept failed (errno = %d)!\n", errno_val);
+ return;
}
printf ("SERVER: Got a connection -- fd = %d (0x%08x)!\n",
close (client_fd);
#endif
conn_pool_free (conn);
+ printf ("SERVER: Closed client fd %d\n", client_fd);
#if ! SOCK_SERVER_USE_EPOLL
if (ssm->nfds == (ssm->listen_fd + 1))
#else