Re: Socket weirdness
- From: Goran Sliskovic <gsliskov@xxxxxxxxx>
- Date: Thu, 21 Sep 2006 02:57:25 +0200
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
.
- Follow-Ups:
- Re: Socket weirdness
- From: Dave Sexton
- Re: Socket weirdness
- 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
- Socket weirdness
- Prev by Date: Re: Socket weirdness
- Next by Date: GC problem with large object - .net 1.1
- Previous by thread: Re: Socket weirdness
- Next by thread: Re: Socket weirdness
- Index(es):
Relevant Pages
|
Loading