Forum Discussion

Mithun KB's avatar
Mithun KB
Copper Contributor
Oct 25, 2023

Socket Close Method

https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.close?view=net-6.0 There is a sentence that says "If you set DontLinger to false and specify a zero time-out interval, Close releases the connection and automatically discards outgoing queued data." Our understanding is that when it is used in this way, Close will immediately close the socket discards outgoing queued data. However, what is the difference between setting DontLinger to false and passing a zero-timeout interval to Close, vs setting DontLinger to true without passing a timeout to Close? So in other words lingering with a timeout of zero can be considered equivalent to skip the lingering?

 

Also for UDP there is anything unique or different?

No RepliesBe the first to reply

Resources