Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-886

isBrokenConnection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.4
    • 2.0.5
    • Core

    Description

      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 ?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              maojk jinkai mao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: