I'm pretty new to Netty, but how would one implement a case in Netty 4.x when several protocols (e.g. P1 and P2) are encapsulated inside another protocol?
+-------------+
| decoder |
+-------------+
| encoder |
+-------------+
| muxer |
+-------------+
| demuxer |
+---+------+--+
| |
| |
+------+ +------+
| |
| |
v v
+-------------+ +-------------+
| P1 decoder | | P2 decoder |
+-------------+ +-------------+
| P1 encoder | | P2 encoder |
+-------------+ +-------------+
| P1 handler | | P2 handler |
+-------------+ +-------------+
Is there a way to create nested pipelines, so that decoder<->encoder<->muxer<->demuxer
being the main pipeline would send the data along P1 or P2 pipeline based on the decision of demuxer?
Or maybe there is a way to somehow create (for the sake of clarity) "subchannels" with their own pipelines?
There is no support for "nested Pipelines" yet. It may be part of 4.1.0. For now you need to remove/add handlers on the fly.
See [1] for an example.
[1] https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/portunification/PortUnificationServerHandler.java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With