* Best way to continually discard incoming socket data
@ 2021-06-17 10:38 robert.j.graham
0 siblings, 0 replies; only message in thread
From: robert.j.graham @ 2021-06-17 10:38 UTC (permalink / raw)
To: [email protected]
I wish to be able to discard all incoming data on a socket for some period as efficiently as possible, while still being able to send data on the socket. I think conceptually what I would want is a new socket flag, say, SO_RCVDISCARD, that would just as early as possible in the network stack discard any incoming data after enabled (and not show read readiness on epoll, etc). What I want to avoid is bouncing back and forth from kernel to userland just to discard the data, even if we can avoid the actual data copying the systems calls to continually be notified and instruct the kernel to discard don't make sense.
I've been trying to understand what might be the best way to achieve something similar in modern Linux. Would it be something like submitting a bunch (chain?) of recv()s with MSG_TRUNC on an io_uring, or some sort of splice(), IORING_OP_SPLICE, etc. There are a lot of different facilities available and it seems like a pretty straightforward task, so I'm sure there must be a fairly simple and efficient way, it's just not immediately clear to me what the best approach might be.
Thanks!
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-17 10:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-17 10:38 Best way to continually discard incoming socket data robert.j.graham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox