Re: Socket weirdness
- From: "Dave Sexton" <dave@jwa[remove.this]online.com>
- Date: Thu, 21 Sep 2006 00:28:05 -0400
Hi Goran,
Thanks very much for your response. As it turns out, I still have a lot of questions even though you've answered a few (but you've
created some more :).
I still have yet to answer the question, "Why doesn't the initial blocking Send fail?". I believe now that there are many forces at
work here affecting the answer to my question and that the behavior of some of the socket functions are simply indeterministic due
to network latency, including the blocking Send itself. What, exactly, does a blocking send do that requires it to block?
I'm gonna have to hit the books.
Something else that might be of interest to readers, which I found browsing around for more info on the subject of TCP/IP:
Nagle Algorithm on Wikipedia.org:
http://en.wikipedia.org/wiki/Nagel_algorithm
--
Dave Sexton
"Goran Sliskovic" <gsliskov@xxxxxxxxx> wrote in message news:O4OTojR3GHA.4228@xxxxxxxxxxxxxxxxxxxxxxx
Dave Sexton wrote:
Hi William,
Here are a few questions that I still cannot answer:
1. If shutting down receive on a socket blocks incoming data, does the socket respond with anything when data is actually sent
from the peer?
Not when data is sent by peer, but when data from peer is received. Once that RST segment reaches poor sender, all subsequent
operation (both read and send), should fail with "Connection reset".
server: Shutdown.Recieve
client: send ok
client: send ok
server: receives data -> send back RST immediatly
client: send ok
client: send ok
client: TCP stack receives RST
client: send failes with "Connection reset"
client: send failes with "Connection reset"
client: send failes with "Connection reset"
...
2. What actually is sent; ACK or RST, ACK and RST, nothing, or something else?
RST.
3. Is the response immediate?
Sort of. It should RST when data is received that cannot be delivered to application. It may take a while to reach the other side
and also that RST packet could be lost.
4. Does a blocking Send wait for a response before returning to the caller?
Sort of. If OS has enaugh buffer space it will buffer and return immediatly. If not, it will wait for ACK from other side that
will free some buffer space.
5. If Send does wait for a response, why doesn't the initial call to Send fail when RST is received (this question is derived
from how I've understood Alan's explanation thus far)?
See 4.
6. Does BeginSend wait for a response before returning to the caller (I hope not)? Does EndSend wait for a response?
BeginSend should not. EndSend I'm not sure...
...
Regards,
Goran
.
- References:
- Socket weirdness
- From: William Stacey [MVP]
- Re: Socket weirdness
- From: Dave Sexton
- Re: Socket weirdness
- From: William Stacey [MVP]
- Re: Socket weirdness
- From: Dave Sexton
- Re: Socket weirdness
- From: William Stacey [MVP]
- Re: Socket weirdness
- From: Alan J. McFarlane
- Re: Socket weirdness
- From: Dave Sexton
- Re: Socket weirdness
- From: William Stacey [MVP]
- Re: Socket weirdness
- From: Dave Sexton
- Re: Socket weirdness
- From: William Stacey [MVP]
- Re: Socket weirdness
- From: Dave Sexton
- Re: Socket weirdness
- From: Goran Sliskovic
- Socket weirdness
- Prev by Date: Re: Hang when new DirectoryEntry declared
- Next by Date: Adding contraints and inheriting
- Previous by thread: Re: Socket weirdness
- Next by thread: Re: Socket weirdness
- Index(es):
Relevant Pages
|