[ 
https://issues.apache.org/jira/browse/DIRMINA-885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13202432#comment-13202432
 ] 

Emmanuel Lecharny commented on DIRMINA-885:
-------------------------------------------

We don't support partial closing of a channel (ie, if one side decide to close 
the output side, then the reader on the other side will get -1 when trying to 
read the channel.

Right now, we simply close the channel brutally, which is not the best possible 
option. We could have exposed the shutdownInput/shutdownOutput methods, and 
required that the server does not close the session, unless the sessions 
requires it. 

One last thing : if we get a -1 when doing a read, we could also check that the 
channel is closed, and if so, remove the session.
                
> session is closed before the server writes back to the client
> -------------------------------------------------------------
>
>                 Key: DIRMINA-885
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-885
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.2
>         Environment: win XP, jdk 1.6.0_23
>            Reporter: Carusyte
>            Priority: Minor
>
> I am using some kind of test tool as client to send arbitrary data, my 
> decoder and handler work correctly as expected, but MINA closes the session 
> before my encoder is called. As I looked into the source code, 
> AbstractPollingIoProcessor seems to schedule a session remove as long as the 
> # of bytes read from the channel == -1 (line 673 and line 706). As per the 
> documentation of java.nio.channels.ReadableByteChannel.read(ByteBuffer dst), 
> this method returns -1 if the channel has reached end-of-stream, but is it 
> really necessary to close the session even before the client receive any 
> response? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to