[usocket-cvs] r10 - in usocket/trunk: backend doc

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Mon Jan 30 20:36:30 UTC 2006


Author: ehuelsmann
Date: Mon Jan 30 14:36:29 2006
New Revision: 10

Modified:
   usocket/trunk/backend/cmucl.lisp
   usocket/trunk/backend/sbcl.lisp
   usocket/trunk/doc/active-sockets-apis.txt
Log:
Update backends with current progress.

Modified: usocket/trunk/backend/cmucl.lisp
==============================================================================
--- usocket/trunk/backend/cmucl.lisp	(original)
+++ usocket/trunk/backend/cmucl.lisp	Mon Jan 30 14:36:29 2006
@@ -12,21 +12,21 @@
                       :real-condition condition
                       :socket socket))))
 
-(defun open (host port &optional (type :stream))
+(defun socket-connect (host port &optional (type :stream))
   (let* ((socket (ext:connect-to-inet-socket (host-byte-order host) port type))
-         (stream (sys:make-fd-stream socket :input t :output t :element-type 'character))
-         (usocket (make-socket :socket socket :host host :port port :stream stream)))
+         (stream (sys:make-fd-stream socket :input t :output t
+                                     :element-type 'character
+                                     :buffering :full))
+         ;;###FIXME the above line probably needs an :external-format
+         (usocket (make-socket :socket socket
+                               :host host :port port :stream stream)))
     usocket))
 
-(defmethod close ((socket socket))
+(defmethod socket-close ((usocket usocket))
   "Close socket."
-  (ext:close-socket (real-socket socket)))
+  (ext:close-socket (socket usocket)))
 
-(defmethod read-line ((socket socket))
-  (cl:read-line (real-stream socket)))
 
-(defmethod write-sequence ((socket socket) sequence)
-  (cl:write-sequence sequence (real-stream socket)))
 
 (defun get-host-by-address (address)
   (handler-case (ext:host-entry-name

Modified: usocket/trunk/backend/sbcl.lisp
==============================================================================
--- usocket/trunk/backend/sbcl.lisp	(original)
+++ usocket/trunk/backend/sbcl.lisp	Mon Jan 30 14:36:29 2006
@@ -20,7 +20,12 @@
 Returns a usocket object."
   (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket
                                 :type type :protocol :tcp))
-         (stream (sb-bsd-sockets:socket-make-stream socket))
+         (stream (sb-bsd-sockets:socket-make-stream socket
+                                                    :input t
+                                                    :output t
+                                                    :buffering :full
+                                                    :element-type 'character))
+         ;;###FIXME: The above line probably needs an :external-format
          (usocket (make-instance 'usocket :stream stream :socket socket)))
     (handler-case (sb-bsd-sockets:socket-connect socket host port)
       (condition (condition) (handle-condition condition usocket)))

Modified: usocket/trunk/doc/active-sockets-apis.txt
==============================================================================
--- usocket/trunk/doc/active-sockets-apis.txt	(original)
+++ usocket/trunk/doc/active-sockets-apis.txt	Mon Jan 30 14:36:29 2006
@@ -3,6 +3,14 @@
 A document to summarizing which API's of the different implementations
 are associated with 'Step 1'.
 
+Interface to be implemented in step 1:
+
+ - socket-connect
+ - socket-close
+ - get-host-by-address
+ - get-hosts-by-name
+
+(and something to do with errors; maybe move this to step 1a?)
 
 SBCL
 ====
@@ -16,4 +24,21 @@
   DNS name resolution:
   - get-host-by-name
   - get-host-by-address
-  - host-ent-addresses
+  - ::host-ent-addresses
+  - host-ent-name
+
+
+CMUCL
+=====
+
+  sockets:
+  - ext:connect-to-inet-socket
+  - sys:make-fd-stream
+  - ext:close-socket
+
+  DNS name resolution:
+  - ext:host-entry-name
+  - ext::lookup-host-entry
+  - ext:host-entry-addr-list
+  - ext:lookup-host-entry
+



More information about the usocket-cvs mailing list