> Suggestion

From: David Biesack <sasdjb_at_unx.sas.com>
Date: Sat, 27 Apr 1996 20:45:21 -0400

> Date: Sat, 27 Apr 1996 18:01:54 -0400
> From: jslttery_at_gs148.sp.cs.cmu.edu
>
> How difficult would it be to add a toplevel hook which would call
> functions regularly while STk was running. I'm thinking specifically
> of a better socket implementation [...]
> The hook would run every so often and do a non-blocking accept
> on the socket and call the specified function if the accept
> succeeded.
>
> Is this possible with the current implementation, or is such a hook
> facility required?
>
> S.

I think you can use (after millisec form) to do what you want.
I have a disk monitor/meter program which periodically checks my
disk usage:

(define (checkDisk)
  (let ((quota (diskmon-output quotaCommand))
        (disk (diskmon-output diskCommand)))
    (update-meters quota disk)
    ;; schedule checkDisk to run again in interval seconds
    (after (* 1000 interval) '(checkDisk))))

(Interval is the number of seconds between checks;
other details not included here.)

You can use the same scheme (whoa, sorry for the pun)
to check your socket periodically.

-- 
David J. Biesack                              sasdjb_at_unx.sas.com
Object Programming Technology           (919) 677-8000 ext. 7771
SAS Institute Inc.      SAS Campus Drive     Cary, NC 27513-2414
Received on Sun Apr 28 1996 - 02:47:53 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST