#include <fcntl.h>
#include <vcl/vcl_test.h>
#include <sys/epoll.h>
+#include <vppinfra/mem.h>
typedef struct
{
uint16_t port = SOCK_TEST_SERVER_PORT;
vppcom_endpt_t endpt;
+ clib_mem_init_thread_safe (0, 64 << 20);
+
opterr = 0;
while ((c = getopt (argc, argv, "6D")) != -1)
switch (c)
return -1;
}
- rv = vppcom_session_listen (ssm->listen_fd, 10);
- if (rv < 0)
+ if (!ssm->cfg.transport_udp)
{
- errno_val = errno = -rv;
- perror ("ERROR in main()");
- fprintf (stderr, "SERVER: ERROR: listen failed "
- "(errno = %d)!\n", errno_val);
- return -1;
+ rv = vppcom_session_listen (ssm->listen_fd, 10);
+ if (rv < 0)
+ {
+ errno_val = errno = -rv;
+ perror ("ERROR in main()");
+ fprintf (stderr, "SERVER: ERROR: listen failed "
+ "(errno = %d)!\n", errno_val);
+ return -1;
+ }
}
ssm->epfd = vppcom_epoll_create ();
{
int num_ev;
num_ev = vppcom_epoll_wait (ssm->epfd, ssm->wait_events,
- SOCK_SERVER_MAX_EPOLL_EVENTS, 60.0);
+ SOCK_SERVER_MAX_EPOLL_EVENTS, 60000.0);
if (num_ev < 0)
{
errno = -num_ev;