[usocket-cvs] r208 - usocket/trunk/backend

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Fri Mar 2 21:58:18 UTC 2007


Author: ehuelsmann
Date: Fri Mar  2 16:58:17 2007
New Revision: 208

Modified:
   usocket/trunk/backend/cmucl.lisp
Log:
Fix closing of (stream) sockets (and comment); followup to r207.

Modified: usocket/trunk/backend/cmucl.lisp
==============================================================================
--- usocket/trunk/backend/cmucl.lisp	(original)
+++ usocket/trunk/backend/cmucl.lisp	Fri Mar  2 16:58:17 2007
@@ -91,11 +91,19 @@
                                      :buffering :full)))
     (make-stream-socket :socket sock :stream stream)))
 
-(defmethod socket-close ((usocket usocket))
+;; Sockets and socket streams are represented
+;; by different objects. Be sure to close the
+;; socket stream when closing a stream socket.
+(defmethod socket-close ((usocket stream-usocket))
   "Close socket."
   (with-mapped-conditions (usocket)
     (close (socket-stream usocket))))
 
+(defmethod socket-close ((usocket usocket))
+  "Close socket."
+  (with-mapped-conditions (usocket)
+    (ext:close-socket (socket usocket))))
+
 (defmethod get-local-name ((usocket usocket))
   (multiple-value-bind
       (address port)



More information about the usocket-cvs mailing list