diff -ur -x .svn usocket-svn/README usocket-accept/README
--- usocket-svn/README	2006-10-07 20:49:57.000000000 -0400
+++ usocket-accept/README	2006-10-20 11:50:50.000000000 -0400
@@ -30,19 +30,42 @@
 
 usocket interface:
 
- - usocket (class)
- - socket-connect (function) [ to create an active/connected socket ]
+ - usocket-basic (class)
+     the common base class for usocket-peer and usocket-server
+ - usocket-peer (class)
+     a socket connected to a remote peer
+ - usocket-server (class)
+     a socket listening for new connections
+ - usocket
+     a deprecated alias for usocket-basic
+
+ - socket-connect (function) [ to create a peer socket ]
     socket-connect host port
       where `host' is a vectorized ip
                       or a string representation of a dotted ip address
                       or a hostname for lookup in the DNS system
+ - socket-stream (usocket-basic slot accessor)
+    socket-stream peer-socket
+      the return value of which satisfies the normal stream interface
  - socket-close (method)
     socket-close socket
       where socket a previously returned socket
- - socket-stream (usocket slot accessor),
-    socket-stream socket
-      the return value of which satisfies the normal stream interface
 
+ - socket-listen (function) [ to create a passive/server socket ]
+    socket-listen port &optional (host *default-host*)
+                                 (backlog *default-backlog-size*)
+      where `host' is a vectorized ip
+                      or a string representation of a dotted ip address
+		      or a hostname for lookup in the DNS system
+      `host' and `backlog' are ignored on systems that do not support
+      specifying them
+ - socket-accept (method)
+     server-accept server-socket
+       returns a newly connected peer socket
+ - *default-host* (variable)
+     the default host to bind server sockets to. 0.0.0.0 by default.
+ - *default-backlog-size* (variable)
+      the default connection backlog size. 5 by default.
 
 Errors:
  - address-in-use-error
diff -ur -x .svn usocket-svn/backend/sbcl.lisp usocket-accept/backend/sbcl.lisp
--- usocket-svn/backend/sbcl.lisp	2006-10-07 20:49:57.000000000 -0400
+++ usocket-accept/backend/sbcl.lisp	2006-10-20 11:59:23.000000000 -0400
@@ -58,44 +58,67 @@
                    (signal 'unkown-condition
                            :real-condition condition))))))
 
+(defun sb-make-socket (socket)
+  "Makes a USOCKET from an SB-BSD-SOCKETS:SOCKET."
+  (let ((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
+    (make-instance 'usocket-peer :stream stream :socket socket)))
+
+(defun make-sb-socket-stream (socket)
+  "Makes a stream from an SB-BSD-SOCKETS:SOCKET."
+  (sb-bsd-sockets:socket-make-stream socket :input t :output t
+				     :buffering :full :element-type 'character))
 
 (defun socket-connect (host port)
   (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket
                                 :type :stream :protocol :tcp))
-         (stream (sb-bsd-sockets:socket-make-stream socket
-                                                    :input t
-                                                    :output t
-                                                    :buffering :full
-                                                    :element-type 'character))
+         (stream (make-sb-socket-stream socket))
          ;;###FIXME: The above line probably needs an :external-format
-         (usocket (make-instance 'usocket :stream stream :socket socket))
+         (usocket (make-instance 'usocket-peer :stream stream :socket socket))
          (ip (host-to-vector-quad host)))
     (with-mapped-conditions (usocket)
       (sb-bsd-sockets:socket-connect socket ip port))
     usocket))
 
-(defmethod socket-close ((usocket usocket))
+(defmethod socket-close ((usocket usocket-basic))
   (with-mapped-conditions (usocket)
-    (sb-bsd-sockets:socket-close (socket usocket))))
+    (sb-bsd-sockets:socket-close (socket usocket))
+    nil))
 
-(defmethod get-local-name ((usocket usocket))
+(defmethod get-local-name ((usocket usocket-basic))
   (sb-bsd-sockets:socket-name (socket usocket)))
 
-(defmethod get-peer-name ((usocket usocket))
+(defmethod get-peer-name ((usocket usocket-peer))
   (sb-bsd-sockets:socket-peername (socket usocket)))
 
-(defmethod get-local-address ((usocket usocket))
+(defmethod get-local-address ((usocket usocket-basic))
   (nth-value 0 (get-local-name usocket)))
 
-(defmethod get-peer-address ((usocket usocket))
+(defmethod get-peer-address ((usocket usocket-peer))
   (nth-value 0 (get-peer-name usocket)))
 
-(defmethod get-local-port ((usocket usocket))
+(defmethod get-local-port ((usocket usocket-basic))
   (nth-value 1 (get-local-name usocket)))
 
-(defmethod get-peer-port ((usocket usocket))
+(defmethod get-peer-port ((usocket usocket-peer))
   (nth-value 1 (get-peer-name usocket)))
 
+(defun socket-listen (port &optional (host *DEFAULT-HOST*)
+		      (backlog *DEFAULT-BACKLOG-SIZE*))
+  (let ((socket (make-instance 'sb-bsd-sockets:inet-socket
+			       :type :stream :protocol :tcp)))
+    (sb-bsd-sockets:socket-bind socket host port)
+    (sb-bsd-sockets:socket-listen socket backlog)
+    (make-instance 'usocket-server :socket socket)))
+
+(defmethod socket-accept ((server-socket usocket-server))
+  (sb-make-socket
+   (with-mapped-conditions (server-socket)
+     (sb-bsd-sockets:socket-accept (socket server-socket)))))
 
 (defun get-host-by-address (address)
   (with-mapped-conditions ()
diff -ur -x .svn usocket-svn/doc/backends.txt usocket-accept/doc/backends.txt
--- usocket-svn/doc/backends.txt	2006-10-07 20:49:57.000000000 -0400
+++ usocket-accept/doc/backends.txt	2006-10-08 02:54:41.000000000 -0400
@@ -13,7 +13,7 @@
  - socket-connect
  - get-hosts-by-name [ optional ]
  - get-host-by-address [ optional ]
-
+ - socket-listen
 
 Methods:
 
@@ -27,6 +27,9 @@
  - get-local-port
  - get-peer-address
  - get-peer-port
 
 
 An error-handling function, resolving implementation specific errors
diff -ur -x .svn usocket-svn/package.lisp usocket-accept/package.lisp
--- usocket-svn/package.lisp	2006-10-07 20:49:57.000000000 -0400
+++ usocket-accept/package.lisp	2006-10-20 11:49:44.000000000 -0400
@@ -10,7 +10,10 @@
 (eval-when (:execute :load-toplevel :compile-toplevel)
   (defpackage :usocket
       (:use :cl)
-    (:export #:socket-connect ; socket constructors and methods
+    (:export #:*default-backlog-size* ; special variables
+	     #:*default-host*
+
+	     #:socket-connect ; socket constructors and methods
              #:socket-close
              #:get-local-address
              #:get-peer-address
@@ -19,9 +22,16 @@
              #:get-local-name
              #:get-peer-name
 
+	     #:socket-listen ; server socket constructors and methods
+	     #:socket-accept
+
              #:with-connected-socket ; macros
+	     #:with-socket
 
-             #:usocket ; socket object and accessors
+             #:usocket ; socket classes and accessors
+	     #:usocket-basic
+	     #:usocket-peer
+	     #:usocket-server
              #:socket
              #:socket-stream
 
@@ -35,4 +45,3 @@
              #:socket-error ; errors
              #:unknown-condition
              #:unknown-error)))
-
diff -ur -x .svn usocket-svn/usocket.lisp usocket-accept/usocket.lisp
--- usocket-svn/usocket.lisp	2006-10-18 09:06:58.000000000 -0400
+++ usocket-accept/usocket.lisp	2006-10-20 11:50:24.000000000 -0400
@@ -1,29 +1,46 @@
-;;;; $Id: usocket.lisp 119 2006-10-18 06:56:33Z ehuelsmann $
+;;;; $Id: usocket.lisp 117 2006-06-08 21:35:51Z ehuelsmann $
 ;;;; $URL: svn://common-lisp.net/project/usocket/svn/usocket/trunk/usocket.lisp $
 
 ;;;; See LICENSE for licensing information.
 
 (in-package :usocket)
 
-
-
-(defclass usocket ()
+(defclass usocket-basic ()
   ((socket
     :initarg :socket
     :accessor socket
-    :documentation "Implementation specific socket object instance.")
-   (stream
+    :documentation "Implementation specific socket object instance.")))
+
+(defclass usocket-peer (usocket-basic)
+   ((stream
     :initarg :stream
     :accessor socket-stream
     :documentation "Implementation specific socket stream instance.")))
 
+(defclass usocket-server (usocket-basic) ())
+ 
+;; A deprecated, backwards-compatibility alias for USOCKET-PEER.
+;; XXX: Is there a better way to do this?
+(defclass usocket (usocket-basic) ())
+
+(defvar *default-backlog-size* 5
+  "The default connection backlog size.")
+
+(defvar *default-host* #(0 0 0 0)
+  "The default IP address for server sockets to bind to.")
+
 (defun make-socket (&key socket stream)
-  "Create a usocket socket type from implementation specific socket
+  "Create a usocket-peer socket type from implementation specific socket
 and stream objects."
-  (make-instance 'usocket
+  (make-instance 'usocket-peer
                  :socket socket
                  :stream stream))
 
+(defun make-server-socket (socket)
+  "Create a usocket-server socket type from an implementation-specific socket
+object."
+  (make-instance 'usocket-server :socket socket))
+
 (defun open-stream (peer-host peer-port
                               &key (local-host :any)
                               (local-port 0)
@@ -45,39 +62,46 @@
       (socket-stream sock))))
 
 (defgeneric socket-close (usocket)
-  (:documentation "Close a previously opened `usocket'."))
+  (:documentation "Close a previously opened USOCKET-BASIC."))
 
-(defgeneric get-local-address (socket)
-  (:documentation "Returns the IP address of the socket."))
+(defgeneric get-local-address (usocket)
+  (:documentation "Returns the IP address of the given USOCKET-BASIC."))
 
-(defgeneric get-peer-address (socket)
+(defgeneric get-peer-address (usocket)
   (:documentation
-   "Returns the IP address of the peer the socket is connected to."))
+   "Returns the IP address of the peer the given USOCKET-PEER is connected
+to."))
 
-(defgeneric get-local-port (socket)
-  (:documentation "Returns the IP port of the socket."))
+(defgeneric get-local-port (usocket)
+  (:documentation "Returns the IP port of the given USOCKET-BASIC."))
 
-(defgeneric get-peer-port (socket)
-  (:documentation "Returns the IP port of the peer the socket to."))
+(defgeneric get-peer-port (usocket)
+  (:documentation "Returns the IP port of the peer the given USOCKET-PEER
+is connected to."))
 
-(defgeneric get-local-name (socket)
-  (:documentation "Returns the IP address and port of the socket as values."))
+(defgeneric get-local-name (usocket)
+  (:documentation "Returns the IP address and port of the given
+USOCKET-BASIC as values."))
 
-(defgeneric get-peer-name (socket)
+(defgeneric get-peer-name (usocket)
   (:documentation
-   "Returns the IP address and port of the peer
-the socket is connected to as values."))
+   "Returns the IP address and port of the peer the given USOCKET-PEER is 
+connected to as values."))
 
-(defmacro with-connected-socket ((var socket) &body body)
-  "Bind `socket' to `var', ensuring socket destruction on exit.
+(defgeneric socket-accept (usocket-server)
+  (:documentation "Blocks until a client connects to the given server
+socket; returns a newly created peer socket connected to the client."))
 
-The `body' is an implied progn form."
+(defmacro with-socket ((var socket) &body body)
+  "Bind `socket' to `var', ensuring socket destruction on exit.
+The `body' is an implicit progn form."
   `(let ((,var ,socket))
-     (unwind-protect
-         (progn
-           ,@body)
-       (when ,var
-         (socket-close ,var)))))
+     (unwind-protect (progn ,@body)
+       (when ,var (socket-close ,var)))))
+
+(defmacro with-connected-socket ((var socket) &body body)
+  "A deprecated alias for WITH-SOCKET."
+  `(with-socket (,var ,socket) ,@body))
 
 ;;
 ;; IPv4 utility functions
@@ -183,22 +207,16 @@
 ;; Documentation for the function
 ;;
 ;; (defun SOCKET-CONNECT (host port) ..)
+;; (defun SOCKET-LISTEN (port &optional host backlog)
 ;;
 
 (setf (documentation 'socket-connect 'function)
-      "Connect to `host' on `port'.  `host' is assumed to be a string or
+      "Connect to `host' on `port'.  `host' is assumed to be a string of
 an IP address represented in vector notation, such as #(192 168 1 1).
 `port' is assumed to be an integer.
 
 Returns a usocket object.")
 
-;; Documentation for the function
-;;
-;; (defun SOCKET-LISTEN (host port &key local-ip local-port
-;;                                      reuseaddress backlog) ..)
-
-
-;; Documentation for the function
-;;
-;; (defun SOCKET-ACCEPT (socket &key element-type external-format
-;;                                   buffered timeout) ..)
+(setf (documentation 'socket-listen 'function)
+      "Returns a server socket listening on the given port and bound
+to the given address. Also allows a backlog to be specified.")
