Re: [tkined] Starting Jobs

Doug Hughes (Doug.Hughes@Eng.Auburn.EDU)
Wed, 13 May 1998 20:30:32 -0500

>
>On Sun, 10 May 1998, Juergen Schoenwaelder wrote:
>
>> You should not need to build such a loop. You should use fileevent
>> to wait read from sockets asynchronously....
>
>How do I time out the reads when I do this? When I connect to, say,
>an SMTP server, the three way handshake may complete, but I may
>not get a 220 from the server within a reasonable amount of time.
>At that point I have to time out and mark the service as down.
>
>> External programs are easy (at least on UNIX): You open a pipe to the
>> program and you use fileevent to read the output from the program.
>
>Again, I'd like to be able to deal with programs that can potentially
>wedge themselves and never return, or take too long to produce
>output. Also, how do I `widow' the ouput pipe to the program? That is,
>how do I close it whilst still leaving the input pipe open so I can
>send it an end of file and read any remaining output?
>

In that case, might I recommend the expect extension? It has timeouts
and will do what you want rather nicely. It would be particularly useful
for things like SMTP negotiation.

If you'd rather do it manually, then TclX provides
the alarm and signal primitives to allow this as well.

Doug Hughes Engineering Network Services
doug@eng.auburn.edu Auburn University

--
!! 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.