You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by uberfoo <jb...@metrosplash.com> on 2008/02/08 01:49:23 UTC

Half Close support

Is there any way for MINA to support half-closed tcp connections?  For
example, a client connects to a server and sends a message.  The client then
sends a TCP packet with the FIN flag.  The server acknowledges the FIN
packet BUT does NOT send a FIN packet.  The connection is now what is
commonly referred to as 'half-closed'.  The server processes the request,
and then sends its response to the client.  Only then does the sever send a
TCP packet with the FIN flag.  The client acknowledges the FIN packet.  The
connection is now fully closed.

In my situation I only have control over the server.  The client is made by
a third party.  So changing the client is out of the question.  

Now when I run tcpdumps of the communications, I've noticed that upon
receiving a packet with a FIN flag, MINA immediately responds with an
acknowledgment WITH the FIN flag set, effectively forcing a 'graceful
connection shutdown'.  Is there a way to instruct MINA not to close the
outgoing connection until I explicitly close it with a call to
IoSession.close()?   I am using version 1.1.5 with Java 1.5.0_09 and
1.5.0_13 on x86 and x84_64 Linux.


-- 
View this message in context: http://www.nabble.com/Half-Close-support-tp15347257s16868p15347257.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Half Close support

Posted by Niklas Therning <ni...@trillian.se>.
uberfoo wrote:
> Is there any way for MINA to support half-closed tcp connections?  For
> example, a client connects to a server and sends a message.  The client then
> sends a TCP packet with the FIN flag.  The server acknowledges the FIN
> packet BUT does NOT send a FIN packet.  The connection is now what is
> commonly referred to as 'half-closed'.  The server processes the request,
> and then sends its response to the client.  Only then does the sever send a
> TCP packet with the FIN flag.  The client acknowledges the FIN packet.  The
> connection is now fully closed.
>
> In my situation I only have control over the server.  The client is made by
> a third party.  So changing the client is out of the question.  
>
> Now when I run tcpdumps of the communications, I've noticed that upon
> receiving a packet with a FIN flag, MINA immediately responds with an
> acknowledgment WITH the FIN flag set, effectively forcing a 'graceful
> connection shutdown'.  Is there a way to instruct MINA not to close the
> outgoing connection until I explicitly close it with a call to
> IoSession.close()?   I am using version 1.1.5 with Java 1.5.0_09 and
> 1.5.0_13 on x86 and x84_64 Linux.
>
>
>   
MINA doesn't support that and I don't think Java NIO supports it either 
at the moment. Maybe the APR transport could be changed to support it 
but the MINA core would also have to be changed to expose that 
functionality through the API.

/Niklas