Socket close notification

  • Thread starter Thread starter Mubashir Khan
  • Start date Start date
M

Mubashir Khan

I am so surprised to find that there is no close notification in socket
class. Like OnClose in MFC CAsyncSocket. Any suggestions please ......
 
Hello!
You wrote on Fri, 17 Nov 2006 04:32:58 -0600:

MK> I am so surprised to find that there is no close notification in socket
MK> class. Like OnClose in MFC CAsyncSocket. Any suggestions please ......

In many cases there can be no notification until you attempt to read or
write (and the operation fails).
Also, as the sockets are synchronous, there's not much sense to make such
notification.

With best regards,
Eugene Mayevski
http://www.SecureBlackbox.com - the comprehensive component suite for
network security
 
Mubashir Khan said:
i am going to use the async methods ......

I haven't actually done any socket stuff in .NET, but...don't you get the
end-receive notification, with a 0 value for the call to EndReceive, to
indicate closure of a socket?
 
I was going to say the same thing. That is what I would do.

--
William Stacey [C# MVP]

| | >i am going to use the async methods ......
|
| I haven't actually done any socket stuff in .NET, but...don't you get the
| end-receive notification, with a 0 value for the call to EndReceive, to
| indicate closure of a socket?
|
|
 
Back
Top