[usocket-devel] Patch for backend/lispworks.lisp
Chun Tian (binghe)
binghe.lisp at gmail.com
Sat Jun 14 06:23:42 UTC 2008
Hi, usocket developer
I think there's two bugs in usocket trunk's backend/lispworks.lisp
1. in function USOCKET-LISTEN, you should listen the stream of a
usocket, not the socket fd itself:
(defun usocket-listen (usocket)
(if (stream-usocket-p usocket)
(when (listen (socket-stream usocket))
usocket)
(when (comm::socket-listen (socket usocket))
usocket)))
2. in function #-win32 WAIT-FOR-INPUT-INTERNAL, mapcar didn't have
a :KEY keyword:
#-win32
(defun wait-for-input-internal (sockets &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?
(mapcar #'(lambda (x) (mp:notice-fd (os-socket-handle x))) sockets)
(mp:process-wait-with-timeout "Waiting for a socket to become
active"
(truncate timeout)
#'(lambda (socks)
(some #'usocket-listen socks))
sockets)
(mapcar #'(lambda (x) (mp:unnotice-fd (os-socket-handle x)))
sockets)
(remove nil (mapcar #'usocket-listen sockets))))
Hope them can be merged. Thanks.
Chun Tian (binghe)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lispworks.diff
Type: application/octet-stream
Size: 1319 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/usocket-devel/attachments/20080614/053c99f7/attachment.obj>
-------------- next part --------------
More information about the usocket-devel
mailing list