[
https://issues.apache.org/jira/browse/DEFT-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098021#comment-13098021
]
Johnathan Meehan edited comment on DEFT-170 at 9/6/11 2:16 PM:
---------------------------------------------------------------
Committed (as per Roger's original proposal).
http://svn.apache.org/viewvc?rev=1165679&view=rev
was (Author: jmeehan):
Committed (as per Roger's original proposal).
> Close channel if we (during read) reach EOF and there is nothing to write
> -------------------------------------------------------------------------
>
> Key: DEFT-170
> URL: https://issues.apache.org/jira/browse/DEFT-170
> Project: Deft
> Issue Type: Improvement
> Reporter: Roger Schildmeijer
> Assignee: Johnathan Meehan
> Fix For: 0.4.0
>
> Attachments: deft-170.patch
>
>
> Proposal: In AS.handleRead(..) add
> if (read == -1) { // EOF
> reachedEOF = true;
> ioLoop.updateHandler(channel, interestOps &=
> ~SelectionKey.OP_READ);
> if (writeBuffer.position() == 0) {
> invokeCloseCallback();
> }
> return;
> }
> (the invokeCloseCallback() + surronding if statement is new)
> Found this issue during DEFT-151 (disitributed demo application).
> The problem is that its easy to leak connection if we dont handle this case.
> The problem is that you never will get a notification/callback that the
> client/server is down (if you only are reading from the asynchronous socket,
> as soon as you try to write to the socket, you will get a close
> callback....but that is _only_ if you acctually try to write on the socket).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira