[usocket-cvs] r684 - in usocket/trunk: . backend vendor

ctian at common-lisp.net ctian at common-lisp.net
Sat Feb 4 10:35:45 UTC 2012


Author: ctian
Date: Sat Feb  4 02:35:44 2012
New Revision: 684

Log:
[CCL] move the implementation of SOCKET-SEND from ccl-send.lisp to openmcl.lisp, with offset support.

Deleted:
   usocket/trunk/vendor/ccl-send.lisp
Modified:
   usocket/trunk/CHANGES
   usocket/trunk/backend/openmcl.lisp
   usocket/trunk/usocket.asd

Modified: usocket/trunk/CHANGES
==============================================================================
--- usocket/trunk/CHANGES	Fri Feb  3 20:31:26 2012	(r683)
+++ usocket/trunk/CHANGES	Sat Feb  4 02:35:44 2012	(r684)
@@ -1,6 +1,7 @@
 0.6.0:
 
-* New feature: SOCKET-OPTION for seting and geting various socket options.
+* New feature: SOCKET-OPTION and (setf SOCKET-OPTION) for seting and geting various socket options.
+* (on the way) New feature: SOCKET-SHUTDOWN for TCP and UDP sockets.
 * Enhancement: SOCKET-CONNECT argument :nodelay now support :if-supported as value (patch from Anton Vodonosov).
 * Enhancement: Add *remote-host* *remote-port* to SOCKET-SERVER stream handler (suggested by Matthew Curry).
 * Bugfix: [LispWorks] Fixed UDP support for LispWorks 6.1 (patch from Camille Troillard by Martin Simmons).
@@ -59,8 +60,3 @@
 
 * New feature: CLISP support some advanced TCP features which CLISP's SOCKET interface not provide
 * New feature: Macintosh Common Lisp (MCL) support Datagram sockets (UDP)
-
-[TODO for 0.6.x]
-
-* New feature: SOCKET-SHUTDOWN for TCP and UDP sockets
-* Fix UDP in CCL 1.7 Windows |send| symbol is gone.

Modified: usocket/trunk/backend/openmcl.lisp
==============================================================================
--- usocket/trunk/backend/openmcl.lisp	Fri Feb  3 20:31:26 2012	(r683)
+++ usocket/trunk/backend/openmcl.lisp	Sat Feb  4 02:35:44 2012	(r684)
@@ -149,14 +149,24 @@
   (with-mapped-conditions (usocket)
     (close (socket usocket))))
 
-(defmethod socket-send ((usocket datagram-usocket) buffer length &key host port)
+(defmethod socket-send ((usocket datagram-usocket) buffer length &key host port offset)
   (with-mapped-conditions (usocket)
     (if (and host port)
 	(openmcl-socket:send-to (socket usocket) buffer length
 				:remote-host (host-to-hbo host)
 				:remote-port port)
-	;; following functino was defined in "vendor/ccl-send.lisp"
-	(ccl::send-for-usocket (socket usocket) buffer length))))
+	;; Clozure CL's socket function SEND-TO doesn't support operations on connected UDP sockets,
+	;; so we have to define our own.
+	(let* ((socket (socket usocket))
+	       (fd (ccl::socket-device socket)))
+	  (multiple-value-setq (buffer offset)
+	    (ccl::verify-socket-buffer buffer offset length))
+	  (ccl::%stack-block ((bufptr length))
+	    (ccl::%copy-ivector-to-ptr buffer offset bufptr 0 length)
+	    (ccl::socket-call socket "send"
+	      (ccl::with-eagain fd :output
+		(ccl::ignoring-eintr
+		  (ccl::check-socket-error (#_send fd bufptr length 0))))))))))
 
 (defmethod socket-receive ((usocket datagram-usocket) buffer length &key)
   (with-mapped-conditions (usocket)

Modified: usocket/trunk/usocket.asd
==============================================================================
--- usocket/trunk/usocket.asd	Fri Feb  3 20:31:26 2012	(r683)
+++ usocket/trunk/usocket.asd	Sat Feb  4 02:35:44 2012	(r684)
@@ -16,7 +16,6 @@
 		 (:module "vendor" :depends-on ("package")
 		  :components ((:file "split-sequence")
 			       #+mcl (:file "kqueue")
-			       #+openmcl (:file "ccl-send")
                                (:file "spawn-thread")))
                  (:file "usocket" :depends-on ("vendor"))
                  (:file "condition" :depends-on ("usocket"))




More information about the usocket-cvs mailing list