mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Celio Cidral" <ce...@kidux.net>
Subject IoAcceptor does not unbind address
Date Fri, 09 Jan 2009 13:12:09 GMT
I'm not sure whether this is an issue or not.  We have experienced that the
NioSocketAcceptor does not unbind the address.  When you
bind(, the NioSocketAcceptor gets a SocketAddress from the
ServerSocketChannel containing a slightly different address:

    protected SocketAddress localAddress(ServerSocketChannel handle)
            throws Exception {
        return handle.socket().getLocalSocketAddress();

The address returned by handle.socket().getLocalSocketAddress() is
"<port>".  Then the acceptor keeps that address and when you
try to unbind() "<port>", it does not find the address and does not
unbind it.  Our workaround is to call unbind() without any parameters, so
that it effectivelly unbind all local addresses.

I've attached a patch (against MINA-2.0 M4) containing a unit test for this
use case.

Best regards,


View raw message