sock_client_main_t *scm = &sock_client_main;
sock_test_socket_t *ctrl = &scm->ctrl_socket;
sock_test_socket_t *tsock;
- int rx_bytes, tx_bytes, nbytes;
- uint32_t i, n;
- int rv;
- int nfds = 0;
+ int rv, nfds = 0, rx_bytes, tx_bytes, nbytes;
+ uint32_t i, n, sidx;
fd_set wr_fdset, rd_fdset;
fd_set _wfdset, *wfdset = &_wfdset;
fd_set _rfdset, *rfdset = &_rfdset;
FD_SET (tsock->fd, &wr_fdset);
FD_SET (tsock->fd, &rd_fdset);
- nfds = ((tsock->fd + 1) > nfds) ? (tsock->fd + 1) : nfds;
+ sidx = vppcom_session_index (tsock->fd);
+ nfds = sidx > nfds ? sidx : nfds;
+// nfds = ((tsock->fd + 1) > nfds) ? (tsock->fd + 1) : nfds;
}
nfds++;
(tsock->stats.stop.tv_nsec == 0)))
continue;
- if (FD_ISSET (tsock->fd, wfdset)
+ if (FD_ISSET (vppcom_session_index (tsock->fd), wfdset)
&& (tsock->stats.tx_bytes < ctrl->cfg.total_bytes))
{
}
- if ((FD_ISSET (tsock->fd, rfdset)) &&
+ if ((FD_ISSET (vppcom_session_index (tsock->fd), rfdset)) &&
(tsock->stats.rx_bytes < ctrl->cfg.total_bytes))
{
rx_bytes = vcl_test_read (tsock->fd, (uint8_t *) tsock->rxbuf,