On Sat, 2009-12-26 at 14:05 -0600, Peter Keller wrote:
On Thu, Dec 24, 2009 at 07:19:59PM -0600, Peter Keller wrote:
So, after all that, now I have to check out to see if the echo-server.lisp program works. :)
Ok, after some experimentation and writing my own code based off of the echo-server.lisp code, I've found a bug in the echo-server.lisp code:
In function make-listener-handler, it will timeout after a certain amount of time, this clause is supposed to fire:
(when (eql :timeout event) (warn "Got a server timeout!") (return))
However, it won't because the (eql :timeout event) should be (eql :timeout exception) instead.
The current behavior of the bug is after 15 seconds, the server becomes completely unresponsive. By default this isn't seen because the timeout for the server itself is 10 seconds.
Also, unrelated, the (defvar *sockets* (make-hash-table)) at the top of the file should be (defvar *sockets* nil) instead.
Thanks. I've updated the example
Now, a question, is there a means by which I can have iomux:event-dispatch return control to me for a while at specified intervals, and then go back to multiplexing i/o? This would allow me to not have to put the server machinery into the read/write functions on the streams themselves or be beholden to my processing only on communication boundaries. If I can get a single threaded solution, then I wouldn't have to worry about the usual things with threads concerning data races and whatnot.
(event-dispatch *base* :one-shot t)