Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: TIdIOHandler.ReadStream() hangs if I unplug the network cable
| Subject: | Re: TIdIOHandler.ReadStream() hangs if I unplug the network cable |
| Posted by: | "Adrien Reboisson" (adrien-reboisson-at-astase-dot-c..@lala.com) |
| Date: | Thu, 15 Nov 2007 20:35:45 |
Hi,
> It is not supposed to. You are performing an abnormal disconnection on a
> remote machine. The OS on the other end can't detect such a disconnect in a
> timely fashion, so Indy doesn't know the socket is gone. The OS has to wait
> for the socket to time out internally, which can take HOURS on a Windows
> machine.
OK, I understand. Thank you for your clear and detailled answer.
> Then you will have to set Indy's ReadTimeout property to a value of your own
> choosing (it is set to Infinite by default) and then handle any explicit
> timeouts that occur, even if a disconnect is not the cause.
Are writing functions also concerned by this behavior ? If yes, why is
there no TIdIOHandler.WriteTimeout property ? Is it by design ?
Best regards, and thank you again !
A.R.