Hi,

I'm investigating this (strange) code. It's very likely that there are missing '!', otherwise the test doe snot make any sense...

Thanks for the report.

May I ask you to create a JIRA ? That would help to track down the fixes for the next release.

Thanks !

On 2/9/12 3:41 AM, mjkai wrote:
version 2.0.4

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 ?

2012-02-09



mjkai



--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to