Rejecting connections on open with a ServerSocketChannel
Frederic Bregier
fredbregier at free.fr
Mon Jul 27 07:19:56 EDT 2009
Hi Iain,
I'm not sure but I think there is no option to open a server socket
without beeing able to accept new connections at the bind step in Netty.
But you can add in the pipeline a handler at first position by default
for all new connections that will do the trick (refusing any new
connection).
When the server is ready to listen, you then just have to remove this
handler
from the pipeline.
HTH,
Frederic
Iain McGinniss wrote:
>
> Hello all,
>
> I have a situation in my code where I want to open a server socket
> channel in order to claim the port, but I do not yet want to accept
> any connections on this channel as the rest of the environment isn't
> ready yet. Is there a way to stop the server channel from accepting
> connections (and, preferrably, forcefully reject them), or is my only
> option to close the connection as soon as I'm aware of it, i.e.
> reacting to a ChildChannelStateEvent and calling close on the channel?
>
> Iain
>
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
>
-----
Hardware/Software Architect
--
View this message in context: http://n2.nabble.com/Rejecting-connections-on-open-with-a-ServerSocketChannel-tp3333195p3333257.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list