Azure / DotNetty

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

What is the difference between "CloseAsync" and "DisconnectAsync"? #509

Open gsw945 opened 5 years ago

gsw945 commented 5 years ago

IChannelHandlerContext's two methods, CloseAsyncand and DisconnectAsync, both can kick off the client.

There are two questions:

  1. What's the difference between these two methods?
  2. Which method is recommended to kick off the client?

thanks !

egmkang commented 4 years ago

https://github.com/Azure/DotNetty/blob/580bde0415a50e570eb9a40b08142d28569ec798/src/DotNetty.Transport/Channels/AbstractChannelHandlerContext.cs#L678-L683

TCP的话就是CloseAsync, UDP不一样