Hi all,
What i want to know is , is there a way to read all the data that is in
the kernel buffer for a socket fd ??
(which is socket fd for a TCP connection). I can make sure , new data
is not coming in kernel buffer for this
fd. I will be using kernel module which inserts hooks with netfilter
and drop all packets for that connection when that module is told to do
so.
Can i use non blocking read calls with large count and calling this
read multiple times ?? Is there guarantee
that all the data that is in the kernel buffer if there is some data
with non-blocking read ?? And i can safely
conclude from return value that i have read everything .
Is there anything that can go wrong in this ?? Can non blocking read
return even when there is data to be read
without specifying correct return value ??
Or if this is not possible and i know how many bytes of data is lying
in kernel buffer for this fd
can i just issue a blocking call with that count and get all data till
i get everything ??
Thanks ,
Rohit
|