Is it possible for Netty to have 2 Pipelines / 2 Channels listening on the same port?

38 views
Skip to first unread message

erb...@gmail.com

unread,
Jan 16, 2017, 9:16:18 PM1/16/17
to Netty discussions

I am wondering if it is possible to have two different ChannelPipeline, getting bootstrapped with the same local port?


The way I set up my pipeline is through ClientBootstrap.connect(remoteAddress). I didn't provide a local port. In this case, I think the OS will manage the local port assignment for me. Is it possible that if I run out of available port or for some other reason, I end up getting two pipelines or two channels listening to the same local port?


If thats possible, and if that local port receives a message, which pipeline will receive & handle that message? Or both pipeline will get notified and handle it?


Thanks!

Erben

Norman Maurer

unread,
Jan 17, 2017, 3:02:08 AM1/17/17
to ne...@googlegroups.com
Its not possible… if you run out of ports the OS will signal an error and so you will get an exception.

--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/93276b73-1e63-4859-bae0-77fee3b7368c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ning Sun

unread,
Jan 17, 2017, 3:16:05 AM1/17/17
to ne...@googlegroups.com
By the way, if you have WebSocket or TLS you can setup a protocol
negotiation process at handshake phase. Then you can speak two different
application protocol on same port.
> --
> You received this message because you are subscribed to the Google
> Groups "Netty discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to netty+un...@googlegroups.com
> <mailto:netty+un...@googlegroups.com>.
> <https://groups.google.com/d/msgid/netty/93276b73-1e63-4859-bae0-77fee3b7368c%40googlegroups.com?utm_medium=email&utm_source=footer>.
signature.asc
Reply all
Reply to author
Forward
0 new messages