Azure / DotNetty

DotNetty project – a port of netty, event-driven asynchronous network application framework
Other
4.09k stars 977 forks source link

How to use both TCP and UDP, and to associate with each other #216

Closed qcjxberin closed 7 years ago

qcjxberin commented 7 years ago

How to use both TCP and UDP, and to associate with each other? I now want to do a P2P NAT function, need to use both TCP and UDP, and TCP and UDP need to work in an application.

nayato commented 7 years ago

Sorry, but the question really has nothing to do with the library. DotNetty provides channel implementations for both TCP and UDP. How you bind them together is up to you. In a basic form whatever comes from network goes through channel's pipeline as a series of ChannelRead calls on Channel Handlers and it's up to you to implement Channel Handler to work with the incoming messages. You then can also write to a channel using WriteAsync + Flush on a Channel.