Re: [htdig3-dev] Connection Time Out


Geoff Hutchison (ghutchis@wso.williams.edu)
Thu, 13 May 1999 11:07:00 -0400 (EDT)


On Thu, 13 May 1999, Gabriele Bartolini wrote:

> I wanna ask you a question about the connection time out. How does it
> really work?

It's done through htlib/Connection.cc

> that's all: if I am not wrong htdig source "touches" the connection timeout
> only at this point ...

Right. The Connection class takes care of the rest.

> But when I can't reach a response from a server and the connection falls
> down or the timeout expires, how can I recognize it?

in Document.cc:
    // Setup a timeout for the connection
    //
    c.timeout(config.Value("timeout"));

    DocStatus returnStatus = Document_ok;;
    switch (readHeader(c))

.. (Document::readHeader)
       c.read_line(line, "\n");

If the connection timed out, I'm pretty sure this returns -1. For example
from Connection.cc:
      if (!need_io_stop)
          count = ::read(sock, buffer, maxlength);
      else
          count = -1; // Input timed out

-Geoff Hutchison
Williams Students Online
http://wso.williams.edu/

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
htdig3-dev@htdig.org containing the single word "unsubscribe" in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Thu May 13 1999 - 08:17:56 PDT