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

when client want to connect to server by binding wrong ip address,there is a bug.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.7
    • Fix Version/s: 2.0.8
    • Component/s: Core
    • Labels:
      None
    • Environment:
      aix6.1

      Description

      look at below codes, when localAddress is not right of client machine,it will throw java.net.BindException.
      then, it will have no chance to do this : ch.socket().close()
      this problem is that the file handle will never be released.
      I have test in aix and the way of getting nums of file handle is:
      lsof -s |grep java

      source code
      mina2.0.7

      NioSocketConnector.java
          protected SocketChannel newHandle(SocketAddress localAddress) throws Exception {
              SocketChannel ch = SocketChannel.open();
      
              int receiveBufferSize = (getSessionConfig()).getReceiveBufferSize();
              if (receiveBufferSize > 65535) {
                  ch.socket().setReceiveBufferSize(receiveBufferSize);
              }
      
              if (localAddress != null) {
                  ch.socket().bind(localAddress);
              }
              ch.configureBlocking(false);
              return ch;
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                wallgreat wallgreat
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: