Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to read all data from kernel buffer for a socket fd (which uses TCP )

Reply
Thread Tools Display Modes

How to read all data from kernel buffer for a socket fd (which uses TCP )

 
 
will_u_tellmemore
Guest
Posts: n/a

 
      12-21-2006, 01:23 PM
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Clear UDP socket kernel buffer. Joe Beanfish Linux Networking 0 08-17-2009 05:31 PM
Is count of un acknowldged bytes maitained anywhere in kernel data structures for TCP socket ? Rohit Linux Networking 0 05-14-2007 12:23 PM
How to get data in kernel SEND buffer for a TCP socket from a netfilter based kernel module Rohit Linux Networking 0 05-10-2007 11:27 AM
Monitor UDP socket buffer Frederic Mayot Linux Networking 0 03-16-2007 01:57 PM
socket buffer size Pirabhu Raman Linux Networking 1 08-18-2004 09:48 PM



1 2 3 4 5 6 7 8 9 10 11