Re: Connection broken on recv() function
- From: Waleri Todorov <waleri@xxxxxxxxxxxxxxx>
- Date: Fri, 16 Sep 2005 00:15:12 +0200
"Kwokho" <kwokho74@xxxxxxxxxxx> wrote in message news:eoGM6LQuFHA.992
@TK2MSFTNGP12.phx.gbl...
> >> I use recv() function to receive data from the client socket (blocked).
> >> If
> >> the client has terminated the process, the function returns SOCKET_ERROR
> >> with the error code WSAECONNRESET(10054). Then I can handle this error by
> >> determinating the error code.
> >>
> >> However, when I unplug the LAN cable on the client's computer, the
> >> function
> >> does not return, it still blocked in the recv() function. Is there any
> >> way
> >> to set the recv() function return immediately or within a certain time?
> >> And
> >> I don't want to use a nonblock socket.
I believe this behave may depend on network card and/or driver.
On my system (W2K) whenever I unplug the cable:
a) Network indicator in the tray changes to "cable unplugged"
b) All applications that uses sockets disconnects immediately
For example ICQ 2003 need some time to determine when internet
connection is gone, when there is problem with the traffic. However,
whenever cable is unplugged, it reports connection loss right away.
.
- Follow-Ups:
- Re: Connection broken on recv() function
- From: Arkady Frenkel
- Re: Connection broken on recv() function
- References:
- Connection broken on recv() function
- From: Kwokho
- Re: Connection broken on recv() function
- From: Arkady Frenkel
- Re: Connection broken on recv() function
- From: Mike Weller
- Connection broken on recv() function
- Prev by Date: Calling SHGetFolderPath
- Next by Date: Re: Calling SHGetFolderPath
- Previous by thread: Re: Connection broken on recv() function
- Next by thread: Re: Connection broken on recv() function
- Index(es):
Relevant Pages
|