-
Notifications
You must be signed in to change notification settings - Fork 521
-
I am researching liburing, but I have problem with following concept.
Let suppose we have HTTP server with keep-alive enabled for 5 minutes.
This means if a client connects, it can stay connected for 5 minutes without sending any data.
How this can be done? If we used epoll, we can just close the client FD and then epoll_ctl(EPOLL_CTL_DEL).
However after asking some AI, I understood that even the FD is closed, there still may be pending data (read / write etc) for the FD we just closed. When we receive it, it may point to memory which is free-ed or reused for different client.
What is the correct way to do this?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
Just issue a cancel for the request?
Beta Was this translation helpful? Give feedback.
All reactions
-
is it guaranteed to work OK? what if in the same exact moment some data come in?
Beta Was this translation helpful? Give feedback.
All reactions
-
You'll get a CQE either way, either sayings it's canceled or with the data received.
Beta Was this translation helpful? Give feedback.
All reactions
-
last question
if I use
io_uring_prep_link_timeout,
how scalable it is? what if I have 10,000 connected clients?
Beta Was this translation helpful? Give feedback.