[usocket-devel] [bug] WAIT-FOR-INPUT cannot be called without :TIMEOUT

Chun Tian (binghe) binghe.lisp at gmail.com
Sun Sep 7 15:09:40 UTC 2008


Hi, usocket

Just found a bug on 0.4.x branch, on LispWorks (non-win32 version).

The WAIT-FOR-INPUT-INTERNAL function has a TRUNCATE operation on  
TIMEOUT:

   (defun wait-for-input-internal (wait-list &key timeout)
     (with-mapped-conditions ()
       ;; unfortunately, it's impossible to share code between
       ;; non-win32 and win32 platforms...
       ;; Can we have a sane -pref. complete [UDP!?]- API next time,  
please?
       (dolist (x (wait-list-waiters wait-list))
         (mp:notice-fd (os-socket-handle x)))
       (mp:process-wait-with-timeout "Waiting for a socket to become  
active"
                                     (truncate timeout) ;; IT'S  
HERE!!!!!!!!!!!!!!!!!!!!!!!!!
                                     #'(lambda (socks)
                                         (let (rv)
                                           (dolist (x socks rv)
                                             (when (usocket-listen x)
                                               (setf (state x) :READ
                                                     rv t)))))
                                     (wait-list-waiters wait-list))
       (dolist (x (wait-list-waiters wait-list))
         (mp:unnotice-fd (os-socket-handle x)))
       wait-list)))

So if I call WAIT-FOR-INPUT on a usocket instance with no TIMEOUT  
keyword supply, (TRUNCATE NIL) will be called, and error happens. How  
to fix this issue to make sure I can just wait "infinitely" on a  
usocket?

Regards,

Chun Tian (binghe)




More information about the usocket-devel mailing list