Socket close notification

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 ......
 
E

Eugene Mayevski

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
 
P

Peter Duniho

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?
 
W

William Stacey [C# MVP]

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?
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top