Networking Forums

Networking Forums > Computer Networking > Linux Networking > Purging socket send buffers

Reply
Thread Tools Display Modes

Purging socket send buffers

 
 
Markus
Guest
Posts: n/a

 
      06-20-2007, 06:05 PM
Hi,

assume you are trying to send data to a remote host over a TCP-
socket. Suddenly the remote host blocks for some unspecified time,
and your socket send buffer fills up until a write call would block.
Is there a way to get rid of the buffered data once it is in the
socket send buffer managed by the kernel?

In my specific case messages become stale very quickly, and it may
have drastic consequences if they get delivered at all if too late.
If the system detects that a remote host is too slow or screwed up, it
should do its best to get rid of any message still under its control.
It would be great if there is a system call that I can use to purge
data buffered in socket send buffers.

Regards,
Markus

 
Reply With Quote
 
 
 
 
Robert Harris
Guest
Posts: n/a

 
      06-20-2007, 07:17 PM
Markus wrote:
> Hi,
>
> assume you are trying to send data to a remote host over a TCP-
> socket. Suddenly the remote host blocks for some unspecified time,
> and your socket send buffer fills up until a write call would block.
> Is there a way to get rid of the buffered data once it is in the
> socket send buffer managed by the kernel?
>
> In my specific case messages become stale very quickly, and it may
> have drastic consequences if they get delivered at all if too late.
> If the system detects that a remote host is too slow or screwed up, it
> should do its best to get rid of any message still under its control.
> It would be great if there is a system call that I can use to purge
> data buffered in socket send buffers.
>
> Regards,
> Markus
>


If you were to do that, then the remote host would never recover because
TCP is a stream, not a sequence of messages. So shutdown() is probably
what you are after.

Robert
 
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
(socket) send transmits data on same packet alexia.bee@gmail.com Linux Networking 2 05-29-2008 07:02 PM
C/C++ socket send causes program to exit Bjorn Nuyttens Linux Networking 2 07-17-2007 08:53 AM
How can I send a struct containing a char * with a socket? Patrick Lam Linux Networking 5 04-03-2006 08:54 PM
How to find the actual memory usage of socket buffers Karthik Nandyal Linux Networking 0 11-11-2004 06:36 PM
Red Hat - How do I figure out and change TCP send/receive buffers? John Davis Linux Networking 2 08-11-2003 12:58 PM



1 2 3 4 5 6 7 8 9 10 11