Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to MSG_PEEK with io_uring #634

Open
sumeetchhetri opened this issue Jul 29, 2022 · 2 comments
Open

How to MSG_PEEK with io_uring #634

sumeetchhetri opened this issue Jul 29, 2022 · 2 comments

Comments

@sumeetchhetri
Copy link

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.

@sumeetchhetri
Copy link
Author

sumeetchhetri commented Aug 1, 2022

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.

@davidzeng0
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants