conn_pool_expand (wrk, SOCK_SERVER_MAX_TEST_CONN + 1);
if (wrk->wrk_index)
- vppcom_worker_register ();
+ if (vppcom_worker_register ())
+ vtfail ("vppcom_worker_register()", 1);
wrk->listen_fd = vppcom_session_create (ssm->cfg.proto,
0 /* is_nonblocking */ );
if (rv < 0)
vtfail ("vppcom_epoll_ctl", rv);
+ ssm->active_workers += 1;
vtinf ("Waiting for a client to connect on port %d ...", ssm->cfg.port);
}
if (wrk->wait_events[i].events & (EPOLLHUP | EPOLLRDHUP))
{
vppcom_session_close (conn->fd);
+ wrk->nfds -= 1;
+ if (!wrk->nfds)
+ {
+ vtinf ("All client connections closed\n");
+ goto done;
+ }
continue;
}
if (wrk->wait_events[i].data.u32 == ~0)
if (EPOLLIN & wrk->wait_events[i].events)
{
+ read_again:
rx_bytes = vcl_test_read (conn->fd, conn->buf,
conn->buf_size, &conn->stats);
if (!wrk->nfds)
{
vtinf ("All client connections closed\n");
- vtinf ("May the force be with you!\n");
goto done;
}
continue;
|| (conn->cfg.test == SOCK_TEST_TYPE_BI))
{
vts_server_rx (conn, rx_bytes);
+ if (vppcom_session_attr (conn->fd, VPPCOM_ATTR_GET_NREAD, 0,
+ 0) > 0)
+ goto read_again;
continue;
}
else if (isascii (conn->buf[0]))