Re: Detecting socket disconnection (Async?)
From: Andreas Håkansson ("Andreas)
Date: 04/16/04
- Next message: Michael Bray: "Re: shared int reference?"
- Previous message: Adam Clauss: "Detecting socket disconnection (Async?)"
- In reply to: Adam Clauss: "Detecting socket disconnection (Async?)"
- Next in thread: Adam Clauss: "Re: Detecting socket disconnection (Async?)"
- Reply: Adam Clauss: "Re: Detecting socket disconnection (Async?)"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Apr 2004 22:46:25 +0200
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: Michael Bray: "Re: shared int reference?"
- Previous message: Adam Clauss: "Detecting socket disconnection (Async?)"
- In reply to: Adam Clauss: "Detecting socket disconnection (Async?)"
- Next in thread: Adam Clauss: "Re: Detecting socket disconnection (Async?)"
- Reply: Adam Clauss: "Re: Detecting socket disconnection (Async?)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|