You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "jinkai mao (Closed) (JIRA)" <ji...@apache.org> on 2012/02/10 14:02:59 UTC

[jira] [Closed] (DIRMINA-886) isBrokenConnection

     [ https://issues.apache.org/jira/browse/DIRMINA-886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jinkai mao closed DIRMINA-886.
------------------------------


It's OK
                
> isBrokenConnection
> ------------------
>
>                 Key: DIRMINA-886
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-886
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.4
>            Reporter: jinkai mao
>            Priority: Minor
>              Labels: isBrokenConnection
>             Fix For: 2.0.5
>
>
> class  :org.apache.mina.transport.socket.nio.NioProcessor 
> Method:protected boolean isBrokenConnection() throws IOException 
>   /**
>      * {@inheritDoc}
>      */
>     @Override
>     protected boolean isBrokenConnection() throws IOException {
>         // A flag set to true if we find a broken session
>         boolean brokenSession = false;
>         synchronized (selector) {
>             // Get the selector keys
>             Set<SelectionKey> keys = selector.keys();
>             // Loop on all the keys to see if one of them
>             // has a closed channel
>             for (SelectionKey key : keys) {
>                 SelectableChannel channel = key.channel();
>                 if (((channel instanceof DatagramChannel) && ((DatagramChannel) channel)
>                         .isConnected())
>                         || ((channel instanceof SocketChannel) && ((SocketChannel) channel)
>                                 .isConnected())) {
>                     // The channel is not connected anymore. Cancel
>                     // the associated key then.
>                     key.cancel();
>                     // Set the flag to true to avoid a selector switch
>                     brokenSession = true;
>                 }
>             }
>         }
>         return brokenSession;
>     }
>  
> --------------------------------------------------------------------------------
> Question: if is need to add ! before ?

--
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