Hello rossu,
[quoted text, click to view] > listener.close
It seems like the option you're looking for here is a way to essentially
cancel the BeginAccept() call. Unfortunately that is not implemented for
the IAsyncResult pattern.
You're best option is to differentiate based on the exception when you call
EndAccept. If it's an ObjectDisposed exception that means that you called
Close on the listener socket someplace else. Otherwise there was a general
issue when someone attempted to connect to the socket.
--
Jared Parsons [MSFT]
jaredpar@online.microsoft.com
All opinions are my own. All content is provided "AS IS" with no warranties,
and confers no rights.