Connection broken on recv() function

Tech-Archive recommends: Speed Up your PC by fixing your registry



Dear all,

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.

Thanks a lot,
Kwokho, Fung


.



Relevant Pages

  • Re: Connection broken on recv() function
    ... I use recv() function to receive data from the client socket. ... with the error code WSAECONNRESET. ... If you really think you need to detect a broken connection then you will need to ...
    (microsoft.public.win32.programmer.networks)
  • Connection broken on recv() function
    ... I use recv() function to receive data from the client socket. ... with the error code WSAECONNRESET. ... Kwokho, Fung ...
    (microsoft.public.win32.programmer.networks)
  • Re: Connection broken on recv() function
    ... put it in a loop and supervise for SOCKET_ERROR return (or infinite loop) ... > I use recv() function to receive data from the client socket. ... > with the error code WSAECONNRESET. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Connection broken on recv() function
    ... Set a receive timeout on your socket. ... > I use recv() function to receive data from the client socket. ... > with the error code WSAECONNRESET. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Connection broken on recv() function
    ... >>> with the error code WSAECONNRESET. ... it still blocked in the recv() function. ... >>> I don't want to use a nonblock socket. ... On my system whenever I unplug the cable: ...
    (microsoft.public.win32.programmer.kernel)