[
https://issues.apache.org/jira/browse/DIRMINA-760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15427937#comment-15427937
]
Emmanuel Lecharny commented on DIRMINA-760:
-------------------------------------------
Not *that* easy to reproduce : doing a {{kill -9}} on the server will properly
close the connection, and the client will disconnect. The best solution to
reproduce the scenario would be to have a remote server, connect the client,
and pull the network cable from the server.
But in this case, there is nothing we can do : we have to wait for the
underlying socket to timeout, and it all depends on your OS configuration.
The only way to 'detect' this use case is to combine the write with the idle
status check. If you have done a write and the connection is idle for a moment
(you decide how long is acceptable), then there is a problem.
To be clear : when you 'write' some data, it ends with some bytes being written
in a system buffer, that will be read and written to the remote peer later. If
teh OS can't write the data, it will retry many times, and it can take quite a
while to be done (check the tcp_retries1 and tcp_retries2 parameter of your OS,
but that may be up to 30 mins...).
> Client fails to detect disconnection
> ------------------------------------
>
> Key: DIRMINA-760
> URL: https://issues.apache.org/jira/browse/DIRMINA-760
> Project: MINA
> Issue Type: Bug
> Components: Core
> Reporter: Omry Yadan
> Fix For: 2.0.8
>
>
> Tested against revision 901694 (which is a bit after 2.0.0-RC1)
> My client need to maintain an open connection to the server.
> If I kill the server right before calling session.write(), the client does
> not detect that the server is gone.
> there is no exceptionCaught event, and messageSent is actually called (which
> suggests successful delivery).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)