Re: Detecting socket disconnection (Async?)
From: Adam Clauss (cabadam_at_tamu.edu)
Date: 04/16/04
- Next message: nsgi_2004: "C# and DirectX"
- Previous message: Will Pittenger: "Re: How do you play sounds in a .NET app?"
- In reply to: Andreas Håkansson: "Re: Detecting socket disconnection (Async?)"
- Next in thread: Andreas Håkansson: "Re: Detecting socket disconnection (Async?)"
- Reply: Andreas Håkansson: "Re: Detecting socket disconnection (Async?)"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Apr 2004 16:58:42 -0500
Hmm... OnReceive gets called for OnDisconnect. Well, I suppose it works, just does not seem very logical.
Thanks!
-- Adam Clauss cabadam@tamu.edu "Andreas Håkansson" <andy.h (at) telia.com> wrote in message news:uwpXkP$IEHA.3544@TK2MSFTNGP09.phx.gbl... > Adam, > > There are two types of disconnects; when the client explicitly closes > the > connection or when the connection is lost due to a network error (connect > went down, etc). > > When the client explicitly closes the connection, your recieve callback will > be called and your will recieve zero bytes - when this happens you know that > the client is question has disconnected. To check for network errors you > will > have to catch the SocketException which you will be getting :) > > HTH, > > //Andreas > > "Adam Clauss" <cabadam@tamu.edu> skrev i meddelandet > news:exjXkM$IEHA.2556@TK2MSFTNGP11.phx.gbl... > > There seems to be various methods to determine when the remote client > disconnects, but all of them I have seen are Synchronous. > > AKA: Right before you try to send or receive data, check. > > > > Is there no way to do raise an event for this? That way you know as soon > as the client disconnects? > > > > There are events for Accepting, Connecting, Receiving, Sending... why not > one for disconnecting? > > > > -- > > Adam Clauss > > cabadam@tamu.edu > > > > > >
- Next message: nsgi_2004: "C# and DirectX"
- Previous message: Will Pittenger: "Re: How do you play sounds in a .NET app?"
- In reply to: Andreas Håkansson: "Re: Detecting socket disconnection (Async?)"
- Next in thread: Andreas Håkansson: "Re: Detecting socket disconnection (Async?)"
- Reply: Andreas Håkansson: "Re: Detecting socket disconnection (Async?)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|