liburing
liburing copied to clipboard
How to MSG_PEEK with io_uring
Is it possible to peek pending socket data without having to register a read call to the uring? Found no examples available for the same.
Ok, so to provide the context here, imagine a client library like libpq (postgresql client) that wraps most of the socket reading part within the api calls, we can very easily register the libpq client socket to a select/poll/epoll backend and interact with postgresql. But in the case of io_uring, there is no mechanism to be able to do the same thing, what is needed here is an event like 'io_uring_prep_recv' [imagine io_uring_prep_recv_peek] which just notifies of pending data and never actually reads it.
Specify MSG_PEEK in the flags of your recv request (should work), or use a io_uring_prep_poll with EPOLLIN to be notified of data