MCPcopy Create free account
hub / github.com/F-Stack/f-stack / conn_poll_for_msg

Function conn_poll_for_msg

dpdk/examples/pipeline/conn.c:297–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297int
298conn_poll_for_msg(struct conn *conn)
299{
300 struct epoll_event event;
301 int fd_client, status, status_data = 0, status_control = 0;
302
303 /* Check input arguments */
304 if (conn == NULL)
305 return -1;
306
307 /* Client group */
308 status = epoll_wait(conn->fd_client_group,
309 &event,
310 1,
311 0);
312 if (status == -1)
313 return -1;
314 if (status == 0)
315 return 0;
316
317 fd_client = event.data.fd;
318
319 /* Data available */
320 if (event.events & EPOLLIN)
321 status_data = data_event_handle(conn, fd_client);
322
323 /* Control events */
324 if (event.events & (EPOLLRDHUP | EPOLLERR | EPOLLHUP))
325 status_control = control_event_handle(conn, fd_client);
326
327 if (status_data || status_control)
328 return -1;
329
330 return 0;
331}

Callers 1

mainFunction · 0.70

Calls 3

epoll_waitFunction · 0.85
data_event_handleFunction · 0.70
control_event_handleFunction · 0.70

Tested by

no test coverage detected