[usocket-cvs] r211 - usocket/trunk

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Sat Mar 3 22:39:39 UTC 2007


Author: ehuelsmann
Date: Sat Mar  3 17:39:39 2007
New Revision: 211

Modified:
   usocket/trunk/usocket.lisp
Log:
Change interface slightly (to prepare to port Drakma) and add documentation.

Modified: usocket/trunk/usocket.lisp
==============================================================================
--- usocket/trunk/usocket.lisp	(original)
+++ usocket/trunk/usocket.lisp	Sat Mar  3 17:39:39 2007
@@ -17,18 +17,26 @@
     :accessor socket
     :documentation "Implementation specific socket object instance."))
   (:documentation
-"The main socket class."))
+"The main socket class.
+
+Sockets should be closed using the `socket-close' method."))
 
 (defclass stream-usocket (usocket)
    ((stream
      :initarg :stream
      :accessor socket-stream
-     :documentation "Stream instance associated with the socket.
-
-Iff an external-format was passed to `socket-connect' or `socket-listen'
-the stream is a flexi-stream. Otherwise the stream is implementation
-specific."))
-   (:documentation ""))
+     :documentation "Stream instance associated with the socket."
+;;
+;;Iff an external-format was passed to `socket-connect' or `socket-listen'
+;;the stream is a flexi-stream. Otherwise the stream is implementation
+;;specific."
+))
+   (:documentation
+"Stream socket class.
+
+Contrary to other sockets, these sockets may be closed either
+with the `socket-close' method or by closing the associated stream
+(which can be retrieved with the `socket-stream' accessor)."))
 
 (defclass stream-server-usocket (usocket)
   ((element-type
@@ -54,7 +62,11 @@
 
 (defun make-stream-socket (&key socket stream)
   "Create a usocket socket type from implementation specific socket
-and stream objects."
+and stream objects.
+
+Sockets returned should be closed using the `socket-close' method or
+by closing the stream associated with the socket.
+"
   (unless socket
     (error 'invalid-socket-error))
   (unless stream
@@ -69,7 +81,8 @@
   "Create a usocket-server socket type from an
 implementation-specific socket object.
 
-The returned value is a subtype of `stream-server-usocket'."
+The returned value is a subtype of `stream-server-usocket'.
+"
   (make-instance 'stream-server-usocket
                  :socket socket
                  :element-type element-type))
@@ -276,7 +289,7 @@
 
 ;; Documentation for the function
 ;;
-;; (defun SOCKET-LISTEN (host port &key reuseaddress backlog) ..)
+;; (defun SOCKET-LISTEN (host port &key reuseaddress backlog element-type) ..)
 ;;###FIXME: extend with default-element-type
 (setf (documentation 'socket-listen 'function)
       "Bind to interface `host' on `port'. `host' should be the



More information about the usocket-cvs mailing list