[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TCP Eval Server...



I have some code based upon the example tcp eval server and have run into
the following problem: after the server has been up for a while (depends
upon how much memory my image has), the periodic task runs out of stack
space. Here's the code that establishes the periodic task:

(defun install-handler-for-tcp-stream (name port fn)
  (%install-periodic-task name
          #'(lambda (&aux stream)
             (declare (special *server-stream-plist*))
             (when (setq stream (getf *server-stream-plist* name))
               (case (tcp-state-name (tcp-connection-state stream))
                  (:established (funcall fn stream))
                  (:close-wait  (close stream))
                  (:closed      (setf (getf *server-stream-plist* name)
                                      (open-tcp-stream nil port
                                              :commandtimeout 300000)))
                  )))
          100))

I modified the original because after a single connection, the server would
go into a close-wait state and refuse connections. Would I be better off
removing the periodic task when it goes into close-wait state and starting
everything over again?

Seth R. Goldman                         Hughes Research Labs
seth@isl.hrl.hac.com                    3011 Malibu Canyon Road
(310) 317-5693 (voice)                  Malibu, CA  90035
(310) 317-5695 (fax)                    USA