You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2014/09/05 12:57:29 UTC

[jira] [Updated] (DIRMINA-928) when client want to connect to server by binding wrong ip address,there is a bug.

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

Emmanuel Lecharny updated DIRMINA-928:
--------------------------------------
    Fix Version/s: 2.0.8

> when client want to connect to server by binding wrong ip address,there is a bug.
> ---------------------------------------------------------------------------------
>
>                 Key: DIRMINA-928
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-928
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.7
>         Environment: aix6.1
>            Reporter: wallgreat
>             Fix For: 2.0.8
>
>
> 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 
> {code}
> 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;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)