[usocket-cvs] r631 - usocket/branches/0.5.x/backend

Chun Tian (binghe) ctian at common-lisp.net
Fri Apr 1 10:51:57 UTC 2011


Author: ctian
Date: Fri Apr  1 06:51:57 2011
New Revision: 631

Log:
[CLISP, LW] Use IP_PROTO_UCP when doing socket() system call.

Modified:
   usocket/branches/0.5.x/backend/clisp.lisp
   usocket/branches/0.5.x/backend/lispworks.lisp

Modified: usocket/branches/0.5.x/backend/clisp.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/clisp.lisp	(original)
+++ usocket/branches/0.5.x/backend/clisp.lisp	Fri Apr  1 06:51:57 2011
@@ -520,6 +520,8 @@
   ;; socket constants
   (defconstant +socket-af-inet+ 2)
   (defconstant +socket-sock-dgram+ 2)
+  (defconstant +socket-ip-proto-udp+ 17)
+
   (defconstant +sockopt-so-rcvtimeo+ #-linux #x1006 #+linux 20 "Socket receive timeout")
 
   (defvar *length-of-sockaddr_in* (ffi:sizeof 'sockaddr_in))
@@ -538,7 +540,7 @@
 				 &key (local-host *wildcard-host*)
 				      remote-host
 				      remote-port)
-    (let ((sock (%socket +socket-af-inet+ +socket-sock-dgram+ 0))
+    (let ((sock (%socket +socket-af-inet+ +socket-sock-dgram+ +socket-ip-proto-udp+))
 	  (lsock_addr (fill-sockaddr_in (ffi:allocate-shallow 'sockaddr_in)
 					local-host local-port))
 	  (rsock_addr (when remote-host

Modified: usocket/branches/0.5.x/backend/lispworks.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/lispworks.lisp	(original)
+++ usocket/branches/0.5.x/backend/lispworks.lisp	Fri Apr  1 06:51:57 2011
@@ -81,6 +81,8 @@
 (defconstant *socket_sock_dgram* 2
   "Connectionless, unreliable datagrams of fixed maximum length.")
 
+(defconstant *socket_ip_proto_udp* 17)
+
 (defconstant *sockopt_so_rcvtimeo*
   #-linux #x1006
   #+linux 20
@@ -186,7 +188,7 @@
   "Open a unconnected UDP socket.
    For binding on address ANY(*), just not set LOCAL-ADDRESS (NIL),
    for binding on random free unused port, set LOCAL-PORT to 0."
-  (let ((socket-fd (comm::socket comm::*socket_af_inet* *socket_sock_dgram* comm::*socket_pf_unspec*)))
+  (let ((socket-fd (comm::socket comm::*socket_af_inet* *socket_sock_dgram* *socket_ip_proto_udp*)))
     (if socket-fd
       (progn
         (when read-timeout (set-socket-receive-timeout socket-fd read-timeout))




More information about the usocket-cvs mailing list