Changeset 431

Show
Ignore:
Timestamp:
10/13/08 02:05:28 (7 weeks ago)
Author:
ctian
Message:

[udp] use :datagram instead of :udp, extend HOST-TO-HBO to support NIL

Location:
usocket/branches/experimental-udp
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • usocket/branches/experimental-udp/backend/allegro.lisp

    r429 r431  
    6565                          (socket:make-socket :remote-host (host-to-hostname host) 
    6666                                              :remote-port port 
    67                                               :local-host (when local-host (host-to-hostname local-host)) 
     67                                              :local-host (host-to-hostname local-host) 
    6868                                              :local-port local-port 
    6969                                              :format (to-format element-type) 
     
    8080                                       :remote-host (host-to-hostname host) 
    8181                                       :remote-port port 
    82                                        :local-host (when local-host (host-to-hostname local-host)) 
     82                                       :local-host (host-to-hostname local-host) 
    8383                                       :local-port local-port 
    8484                                       :format (to-format element-type)) 
     
    8686                                       :address-family :internet 
    8787                                       :local-host local-host 
    88                                        :local-port (when local-host (host-to-hostname local-host)) 
     88                                       :local-port (host-to-hostname local-host) 
    8989                                       :format (to-format element-type))))))) 
    9090    (ecase protocol 
  • usocket/branches/experimental-udp/backend/cmucl.lisp

    r429 r431  
    6868             (with-mapped-conditions (socket) 
    6969               (ext:connect-to-inet-socket (host-to-hbo host) port :stream 
    70                                            :local-host (if local-host 
    71                                                            (host-to-hbo local-host)) 
     70                                           :local-host (host-to-hbo local-host) 
    7271                                           :local-port local-port))) 
    7372       (if socket 
     
    8584           (setf socket (with-mapped-conditions (socket) 
    8685                          (ext:connect-to-inet-socket (host-to-hbo host) port :datagram 
    87                                                       :local-host (if local-host 
    88                                                                       (host-to-hbo local-host)) 
     86                                                      :local-host (host-to-hbo local-host) 
    8987                                                      :local-port local-port))) 
    9088           (progn 
  • usocket/branches/experimental-udp/backend/openmcl.lisp

    r429 r431  
    8282      (:stream 
    8383       (let ((mcl-sock 
    84               (openmcl-socket:make-socket :remote-host (host-to-hostname host) 
     84              (openmcl-socket:make-socket :remote-host (host-to-hbo host) 
    8585                                          :remote-port port 
    86                                           :local-host (when local-host (host-to-hostname local-host)) 
     86                                          :local-host (host-to-hbo local-host) 
    8787                                          :local-port local-port 
    8888                                          :format (to-format element-type) 
     
    9797              (openmcl-socket:make-socket :address-family :internet 
    9898                                          :type :datagram 
    99                                           :local-host (if local-host 
    100                                                           (host-to-hbo local-host)) 
     99                                          :local-host (host-to-hbo local-host) 
    101100                                          :local-port local-port))) 
    102101         (when (and host port) 
     
    141140  (with-mapped-conditions (usocket) 
    142141    (openmcl-socket:send-to (socket usocket) buffer length 
    143                             :remote-host (if address (host-to-hbo address)) 
     142                            :remote-host (host-to-hbo address) 
    144143                            :remote-port port))) 
    145144 
  • usocket/branches/experimental-udp/backend/sbcl.lisp

    r429 r431  
    241241             usocket)) 
    242242          (:datagram 
    243            (when (and local-host local-port) 
     243           (when (or local-host local-port) 
    244244             (sb-bsd-sockets:socket-bind socket 
    245                                          (host-to-vector-quad local-host) 
    246                                          local-port)) 
     245                                         (host-to-vector-quad 
     246                                          (or local-host *wildcard-host*)) 
     247                                         (or local-port *auto-port*))) 
    247248           (when (and host port) 
    248249             (sb-bsd-sockets:socket-connect socket (host-to-hbo host) port)) 
  • usocket/branches/experimental-udp/package.lisp

    r429 r431  
    8181             #:insufficient-implementation ; conditions regarding usocket support level 
    8282             #:unsupported 
    83              #:unimplemented) 
    84  
    85     #+lispworks 
    86     (:import-from :comm 
    87              #:*socket_af_inet* 
    88              #:*socket_pf_unspec* 
    89              #:*sockopt_sol_socket* 
    90              #:%send 
    91              #:bind 
    92              #:close-socket 
    93              #:connect 
    94              #:getsockopt 
    95              #:in_addr 
    96              #:initialize-sockaddr_in 
    97              #:ntohl 
    98              #:ntohs 
    99              #:s_addr 
    100              #:setsockopt 
    101              #:sin_addr 
    102              #:sin_port 
    103              #:sockaddr 
    104              #:sockaddr_in)) 
     83             #:unimplemented)) 
  • usocket/branches/experimental-udp/server.lisp

    r426 r431  
    1111                           (max-buffer-size +max-datagram-packet-size+)) 
    1212  (let ((socket (socket-connect nil nil 
    13                                 :protocol :udp 
     13                                :protocol :datagram 
    1414                                :local-host host 
    1515                                :local-port port 
  • usocket/branches/experimental-udp/usocket.lisp

    r429 r431  
    408408  "Translate a string or vector quad to a stringified hostname." 
    409409  (etypecase host 
     410    (null nil) 
    410411    (string host) 
    411412    ((or (vector t 4) 
     
    461462  (defun host-to-hbo (host) 
    462463    (etypecase host 
     464      (null nil) 
    463465      (string (let ((ip (ignore-errors 
    464466                          (dotted-quad-to-vector-quad host))))