Author: ehuelsmann Date: Tue Jan 31 12:04:58 2006 New Revision: 13
Modified: usocket/trunk/backend/allegro.lisp usocket/trunk/backend/clisp.lisp Log: Update clisp and allegro backends.
Modified: usocket/trunk/backend/allegro.lisp ============================================================================== --- usocket/trunk/backend/allegro.lisp (original) +++ usocket/trunk/backend/allegro.lisp Tue Jan 31 12:04:58 2006 @@ -14,21 +14,18 @@
(defun open (host port &optional (type :stream)) (declare (ignore type)) - (make-socket :socket (sock:make-socket :remote-host host - :remote-port port))) + (let ((socket (sock:make-socket :remote-host host + :remote-port port))) + (make-socket :socket socket :stream socket)))
-(defmethod close ((socket socket)) +(defmethod close ((usocket usocket)) "Close socket." - (sock:close (real-socket socket))) + (sock:close (socket usocket)))
-(defmethod read-line ((socket socket)) - (cl:read-line (real-socket socket)))
-(defmethod write-sequence ((socket socket) sequence) - (cl:write-sequence sequence (real-socket socket)))
(defun get-host-by-address (address) (sock:lookup-host address))
-(defun get-host-by-name (name) +(defun get-hosts-by-name (name) (sock:lookup-host name))
Modified: usocket/trunk/backend/clisp.lisp ============================================================================== --- usocket/trunk/backend/clisp.lisp (original) +++ usocket/trunk/backend/clisp.lisp Tue Jan 31 12:04:58 2006 @@ -12,29 +12,31 @@ :real-condition condition :socket socket))))
-(defun open (host port &optional (type :stream)) +(defun socket-connect (host port &optional (type :stream)) (declare (ignore type)) - (make-socket :socket (socket:socket-connect port host) - :host host - :port port)) + (let ((socket (socket:socket-connect port host + :element-type 'character + :buffered t))) + (make-socket :socket socket + :stream socket ;; the socket is a stream too + :host host + :port port))
-(defmethod close ((socket socket)) +(defmethod socket-close ((usocket usocket)) "Close socket." - (socket:socket-server-close (real-socket socket))) + (close (socket usocket)))
-(defmethod read-line ((socket socket)) - (cl:read-line (real-socket socket)))
-(defmethod write-sequence ((socket socket) sequence) - (cl:write-sequence sequence (real-socket socket)))
(defun get-host-by-address (address) - (handler-case (posix:hostent-name - (posix:resolve-host-ipaddr (vector-quad-to-dotted-quad address))) - (condition (condition) (handle-condition condition)))) - -(defun get-host-by-name (name) - (handler-case (mapcar #'dotted-quad-to-vector-quad - (posix:hostent-addr-list (posix:resolve-host-ipaddr name))) - (condition (condition) (handle-condition condition)))) - + (handler-case + (posix:hostent-name + (posix:resolve-host-ipaddr (vector-quad-to-dotted-quad address))) + (condition (condition) (handle-condition condition)))) + +(defun get-hosts-by-name (name) + (handler-case + (mapcar #'dotted-quad-to-vector-quad + (posix:hostent-addr-list (posix:resolve-host-ipaddr name))) + (condition (condition) (handle-condition condition)))) +