NIO
Hi,
I have a little test server and client application.
The client connects to the server, sends 10 bytes, then exits and the
socket closes.
When the server tries to read these bytes I get an error:
"An existing connection was forcibly closed by the remote host"
The sockets are non-blocking, so I guess it makes sense that the
connection might be closed before all the data is either sent from the
client, or read on the server. However, I'd like to ensure that all the
data is sent before the close takes effect.
I'm using SocketChannels to send the data, then doing a
SocketChannel.close(). I think I need something like "linger" but doing
SocketChannel.socket().setSoLinger(...) doesn't seem to help.
Any ideas?
Thanks.
.
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) |
|