| Andrei Voropaev 2007-04-24, 7:21 am |
| 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
|