Hello, I realize the original should be in the users mailing list but replying here to keep the thread intact.
I have been observing the same issue: - bind() a SocketAcceptor to an address - connect a client to the SocketAcceptor - while the client is connected call dispose() and then unbind() (and tried also with unbind(true)) on the SocketAcceptor - here the vm is terminated and the program restarted - attempting to bind() to the same address results in a "java.net.BindException: Address already in use" 100% of the time. I have even tried dispose() then iterating over ever managed session and calling IoSession.close() and then unbind(). Same result. Regards, Derek On Mon, Jan 27, 2014 at 4:44 AM, Emmanuel Lécharny <[email protected]>wrote: > Hi, > > FTR, dev list is not the right place for such mail. Please use the users > mailing list. > > Have you disposed the acceptor before unbinding it ? If there is any > pending connection, it's likely that the socket will be persisted even > after an Unbind, for the socket timeout (which might be quite long). > > Always close correctly all the sessions programmatically before > unbinding. Dispose do that. > > > Le 1/27/14 10:23 AM, Hardik Kubavat a écrit : > > Hi, > > > > I am unbind the port from IoAcceptor using > > > > ==> acceptor.unbind(new InetSocketAddress(portNo)); > > > > So when we try to bind this same port on acceptor it's throws > > Exception with Following message > > Address already in use. > > > > As per my requirement I need to bind and unbind port dynamically. And > > It is possible that same port we need to unbind and than bind again. > > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.iktek.com > >
