Who should close and when?
- From: "Daniel" <DanielV@xxxxxxxxxxxxxxxx>
- Date: Wed, 22 Feb 2006 00:17:54 -0000
Ok i have just discovered that when one end of a socket connection shutdown
it sends a 0 byte stream to tell the other end that you are at the end of
data.
However it has raised a new issue.
I do the following:
1)Server listens for client connections
2)Server receives connection from client and goes into beginreceive
3)Client sends data and server responds
4)on responding server closes the connection which caused 0 bytes read at
client end
5)client knows it has all the data and handles it
------all is fine to here----
6) Now client sends another request to the server but this time i get a
Error writing to the socket as it is disposed (because i closed it)
So do i need to create a new socket client side everytime i want to send
some data and you continually open and close sockets? Always closed from
server side?
Should the client ever call the close after it sends?
Bit confused. Again.
.
- Follow-Ups:
- Re: Who should close and when? CORRECTION
- From: Daniel
- Re: Who should close and when? CORRECTION
- Prev by Date: SOLVED IT!!
- Next by Date: IPv6 bind with protocol 50 fails
- Previous by thread: Network Adapter Order
- Next by thread: Re: Who should close and when? CORRECTION
- Index(es):
Relevant Pages
|