Who should close and when?



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.


.



Relevant Pages

  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #2]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • Re: Writing a windows service with a socket interface.
    ... It's FAR easier than direct socket ... > and sends a response back to the client. ... Or perhaps if the IP address of the server was modified ... > connection open, I would implement a sort of connection pool of course. ...
    (microsoft.public.dotnet.framework)
  • Cable modem/router causes error 10054, "Connection was forcibly reset by remote host"
    ... If there is no activity on the socket for five minutes, ... no resets are issued by our server or anything else visible on the wire. ... same to be true with an FTP client accessing an FTP site totally unrelated ... client, made five unsuccessful attempts to use its existing connection, then ...
    (microsoft.public.win32.programmer.networks)