Hello,
I'm running 2 UDP simple servers code using sb-bsd-sockets (with SBCL
0.9.11.8) listening on 2 different ports using 2 separate threads (using
bordeaux-mp). This runs OK with linux kernel 2.6 (Debian) on intel32 and
AMD64 (single core).
When I run the same code with Fedora 5, using AMD64 I have the following
error: "socket already bind" for the second socket bound to #(0 0 0 0)
(in the second thread). Same error occurs when using #(* * * *) twice,
for each socket, but the error does not occur when the first socket is
boundd to #(0 0 0 0) and the second socket to #(* * * *).
Something seems not consistant, or looks like a bug (it works more or
less according to linux distro on same kernel), and I can not find what
is wrong in my syntaxe, or if it's just a bug in sb-bsd-socket in SBCL.
Here is my code for the servers called in 2 separate threads listenning
to 2 different ports :
#+sbcl (defun input1-server (som port lenght)
(let ((s (make-instance 'sb-bsd-sockets:inet-socket
:type :datagram :protocol :udp)))
(sb-bsd-sockets:socket-bind s #(0 0 0 0) port)
(loop while runningp do
(multiple-value-bind (buf len address port)
(sb-bsd-sockets:socket-receive s nil lenght)
(myprog1))
(sb-bsd-sockets:socket-close s)))
#+sbcl (defun input2-server (som port lenght)
(let ((s (make-instance 'sb-bsd-sockets:inet-socket
:type :datagram :protocol :udp)))
(sb-bsd-sockets:socket-bind s #(0 0 0 0) port)
(loop while runningp do
(multiple-value-bind (buf len address port)
(sb-bsd-sockets:socket-receive s nil lenght)
(myprog2))
(sb-bsd-sockets:socket-close s)))
Thank you for you help or any suggestion,
Frederic Voisin
|