Netty multiplexing

Frederic Bregier fredbregier at free.fr
Tue Nov 23 12:47:15 EST 2010


Hi,

You asked me by mail also so I will try to help you.
What I've done is:
- Network part:
  1) Codec (FrameDecoder) which is as follow:
     length localId remoteId data
  2) NetworkHandler which does the following:
     Take into account some error message early
     If no error:
     a) Look at the LocalId: if unset (special value) then create a session
(map) which refered to a localChannel (id is the localChannel Id)
     b) Send the data to this localChannel (client side local channel
writing to server side local channel)
     On close connection, finalize everything attached to this network
channel (and so the local channels that could be still opened)

- Local part:
  Local Client side: nothing except validating first connection with the Id
of the newly created local channel with server side
  Local Server side: where all business is, directly writing to network
channel associated with this session (again through the map)

It is quite difficult to post the code, since it is quite a huge code due to
business part. But you can take a look from the SVN web interface:

http://goldengate.svn.sourceforge.net/viewvc/goldengate/GoldenGateR66/trunk/src/main/java/openr66/protocol/
look at networkhandler/NetworkServerHandler.java and
networkhandler/packet/NetworkPacketCodec.java for network part
and localhandler/(LocalClientPipelineFactory.java, LocalClientHandler.java,
LocalServerHandler.java)

If you need more information, please ask... ;-)

Cheers,
Frederic

-----
Hardware/Software Architect
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Netty-multiplexing-tp5766651p5767583.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list