Re: [tkined] Starting Jobs

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Thu, 14 May 1998 09:32:40 +0200

>>>>> Curt Sampson writes:

Curt> How do I time out the reads when I do this? When I connect to,
Curt> say, an SMTP server, the three way handshake may complete, but I
Curt> may not get a 220 from the server within a reasonable amount of
Curt> time. At that point I have to time out and mark the service as
Curt> down.

In pure Tcl, you would schedule an `after' event. Once you get a
response, you will simple cancel the `after' event. Otherwise, the
`after' event will fire up and you close the connection.

So you basically start a timer, which is IMHO the straight-forward
implementaiton of the underlying model. Anyway, using expect as Doug
suggest might make this even easier.

Curt> Again, I'd like to be able to deal with programs that can
Curt> potentially wedge themselves and never return, or take too long
Curt> to produce output.

See above. It does not matter whether the Tcl channel belongs to a
pipe or a TCP connection.

Curt> Also, how do I `widow' the ouput pipe to the program? That is,
Curt> how do I close it whilst still leaving the input pipe open so I
Curt> can send it an end of file and read any remaining output?

I am not sure if you can do this in plain Tcl.
Juergen

Juergen Schoenwaelder schoenw@ibr.cs.tu-bs.de http://www.cs.tu-bs.de/~schoenw
Technical University Braunschweig, Dept. Operating Systems & Computer Networks
Bueltenweg 74/75, 38106 Braunschweig, Germany. (Tel. +49 531 / 391 3283)

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.