Home All Groups Group Topic Archive Search About

Socket close notification

Author
17 Nov 2006 10:32 AM
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 ......

Author
17 Nov 2006 10:46 AM
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
Author
17 Nov 2006 5:25 PM
Mubashir Khan
i am going to use the async methods ......
Show quote
"Eugene Mayevski" <mayev***@eldos.com> wrote in message
news:uKJ$zWjCHHA.4680@TK2MSFTNGP04.phx.gbl...
> 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
Author
17 Nov 2006 5:57 PM
Peter Duniho
"Mubashir Khan" <m***@yahoo.com> wrote in message
news:ue5641mCHHA.4808@TK2MSFTNGP03.phx.gbl...
>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?
Author
17 Nov 2006 7:48 PM
William Stacey [C# MVP]
I was going to say the same thing.  That is what I would do.

--
William Stacey [C# MVP]

Show quote
"Peter Duniho" <NpOeStPe***@NnOwSlPiAnMk.com> wrote in message
news:12lru17nlpo8af1@corp.supernews.com...
| "Mubashir Khan" <m***@yahoo.com> wrote in message
| news:ue5641mCHHA.4808@TK2MSFTNGP03.phx.gbl...
| >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?
|
|

AddThis Social Bookmark Button