You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Mladen Turk (JIRA)" <ji...@apache.org> on 2007/05/23 13:24:16 UTC

[jira] Commented: (DIRMINA-382) Provide a close() method that doesn't close the connection until all messages are written.

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

Mladen Turk commented on DIRMINA-382:
-------------------------------------

Why not add shutdown() instead parameterized close.
It would also allow adding timeout (someting like lingering on standard sockets)


> Provide a close() method that doesn't close the connection until all messages are written.
> ------------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-382
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-382
>             Project: MINA
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Trustin Lee
>             Fix For: 2.0.0-M1
>
>
> Currently, IoSession.close() closes the connection immediately no matter how many messages are not written yet.  Calling close() will discard all pending writes and close the connection immediately.  Although we can add a IoFutureListener.CLOSE to the last WriteFuture, it will be more convenient to provide another close method that doesn't close the connection until all message are written.  
> Adding a boolean parameter to the close method will be fine. Of course, original method without a parameter will be retained.
> To implement this, the implementation should satisfy the following condition.
> 1) IoSession.isClosing() must return true after close() is called no matter what boolean parameter is specified.
> 2) The session should be closed after all messages are written out.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (DIRMINA-382) Provide a close() method that doesn't close the connection until all messages are written.

Posted by Matthew Phillips <ma...@mattp.name>.
On 23/05/2007, at 8:54 PM, Mladen Turk (JIRA) wrote:

> Why not add shutdown() instead parameterized close.
> It would also allow adding timeout (someting like lingering on  
> standard sockets)

Assuming MINA can't go back to close () having this behaviour (I  
think most people would expect a close () to imply a flush), this  
sounds good to me.

Matthew.

RE: [jira] Commented: (DIRMINA-382) Provide a close() method that doesn't close the connection until all messages are written.

Posted by "Smith, David" <DS...@verisign.com>.
I'm running version 0.9.3 and the session.close() actually does not seem
to end the session immediately. We're using session.close() for idle
timeouts, and it works great for well-behaved clients. However, for
clients who don't read the server responses and thus for whom mina is
queuing up write data, the session.close is not closing the session. I
assumed it was because mina was processing the queued events in order
and therefore the CloseFuture would not be acted upon until the writes
had completed.

Again, this is with 0.9.3, so maybe things have changed by 1.1 or maybe
my assumptions are wrong about why the session.close() command isn't
immediate for badly behaved clients.

-----Original Message-----
From: Mladen Turk (JIRA) [mailto:jira@apache.org] 
Sent: Wednesday, May 23, 2007 7:24 AM
To: dev@mina.apache.org
Subject: [jira] Commented: (DIRMINA-382) Provide a close() method that
doesn't close the connection until all messages are written.


    [
https://issues.apache.org/jira/browse/DIRMINA-382?page=com.atlassian.jir
a.plugin.system.issuetabpanels:comment-tabpanel#action_12498196 ] 

Mladen Turk commented on DIRMINA-382:
-------------------------------------

Why not add shutdown() instead parameterized close.
It would also allow adding timeout (someting like lingering on standard
sockets)


> Provide a close() method that doesn't close the connection until all
messages are written.
> ----------------------------------------------------------------------
> --------------------
>
>                 Key: DIRMINA-382
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-382
>             Project: MINA
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Trustin Lee
>             Fix For: 2.0.0-M1
>
>
> Currently, IoSession.close() closes the connection immediately no
matter how many messages are not written yet.  Calling close() will
discard all pending writes and close the connection immediately.
Although we can add a IoFutureListener.CLOSE to the last WriteFuture, it
will be more convenient to provide another close method that doesn't
close the connection until all message are written.  
> Adding a boolean parameter to the close method will be fine. Of
course, original method without a parameter will be retained.
> To implement this, the implementation should satisfy the following
condition.
> 1) IoSession.isClosing() must return true after close() is called no
matter what boolean parameter is specified.
> 2) The session should be closed after all messages are written out.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.