Re: non-blocking socket close
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: non-blocking socket close




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: non-blocking socket close  
Andrei Voropaev


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-24-07 12:21 PM

On 2007-04-22, skaller <skaller@users.sf.net> wrote:
> On Sat, 21 Apr 2007 18:48:56 -0700, David Schwartz wrote:
[...] 
>
> Linux discards the internal buffer contents immediately.
> That's not what I expected but it does seem to happen ;(

It can't be. I've never seen such a behaviour? The buffer is discarded
only if the other side has sent RST. In all other cases, the data
will be sent first and only then the FIN will be sent.

> I have tried with non-blocking sockets and they do the
> right thing, and I have got nice behaviour at the moment
> by adding a 5 second delay between shutdown and close
> on non-blocking sockets. But that is not very nice ;(

You're just doing something wrong, when you have to use tricks with
time-outs. Or the peer of your application does something wrong.

The example code would definetely help to tell where the things go
wrong. BTW. Why do you use "shutdown"?


--
Minds, like parachutes, function best when open





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:05 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register