MCPcopy Create free account
hub / github.com/axboe/liburing / do_rx

Function do_rx

examples/send-zerocopy.c:293–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293static void *do_rx(void *arg)
294{
295 struct thread_data *td = arg;
296 const int cfg_receiver_wait_ms = 400;
297 uint64_t tstop;
298 int ret, fd = td->fd;
299
300 tstop = gettimeofday_ms() + cfg_runtime_ms + cfg_receiver_wait_ms;
301 do {
302 if (cfg_type == SOCK_STREAM)
303 ret = do_flush_tcp(td, fd);
304 else
305 ret = do_flush_datagram(td, fd);
306
307 if (ret)
308 break;
309
310 do_poll(fd, POLLIN);
311 } while (gettimeofday_ms() < tstop);
312
313 if (close(fd))
314 t_error(1, errno, "close");
315 pthread_exit(&td->ret);
316 return NULL;
317}
318
319static inline struct io_uring_cqe *wait_cqe_fast(struct io_uring *ring)
320{

Callers

nothing calls this directly

Calls 5

do_flush_tcpFunction · 0.85
do_flush_datagramFunction · 0.85
do_pollFunction · 0.85
gettimeofday_msFunction · 0.70
t_errorFunction · 0.70

Tested by

no test coverage detected