Best way to continually discard incoming socket data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux