[usocket-devel] r507 : open-mcl : socket-connect scales the timeout value incorrectly

Chun Tian (binghe) binghe.lisp at gmail.com
Sun Jan 3 19:50:19 UTC 2010


Hi, James

Thanks for pointing this. I think you're right.

Let me confirm, so you're suggesting that we should just pass the TIMEOUT argument directly into OPENMCL-SOCKET:MAKE-SOCKET, like below?

(defun socket-connect (host port &key (element-type 'character) timeout deadline nodelay
                       local-host local-port)
  (with-mapped-conditions ()
    (let ((mcl-sock
           (openmcl-socket:make-socket :remote-host (host-to-hostname host)
                                       :remote-port port
                                       :local-host (when local-host (host-to-hostname local-host))
                                       :local-port local-port
                                       :format (to-format element-type)
                                       :deadline deadline
                                       :nodelay nodelay
                                       :connect-timeout timeout))) ; here

      (openmcl-socket:socket-connect mcl-sock)
      (make-stream-socket :stream mcl-sock :socket mcl-sock))))

Regards,

Chun Tian (binghe)

在 2010-1-4,02:10, james anderson 写道:

> good evening;
> 
> in the openmcl backend, socket-connect[1] converts the timeout value  
> to internal runtime units, but (at least for a tcp connection) the  
> respective ccl operator[2] intends to convert from seconds to  
> milliseconds
> 
> 
> ----
> [1] http://trac.common-lisp.net/usocket/browser/usocket/trunk/backend/ 
> openmcl.lisp?rev=499#L89
> [2] http://trac.clozure.com/ccl/browser/trunk/source/level-1/l1- 
> sockets.lisp#L774
>   socket-connect -> make-socket -> make-ip-socket -> make-tcp-socket  
> -> make-tcp-stream-socket
> 
> _______________________________________________
> usocket-devel mailing list
> usocket-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/usocket-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2603 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/usocket-devel/attachments/20100104/0f4c1693/attachment.bin>


More information about the usocket-devel mailing list