From: David Trudgett
Subject: CLISP socket binding loopy?
Date: 
Message-ID: <emppjp$rmr$1@news-02.connect.com.au>
I'm not sure whether it's CLISP's server socket binding that is going 
loopy or whether it's just me... ;-)

Whatever I do, CLISP seems to want to bind on the local loopback 
interface (127.0.0.1), which in turn seems to prevent it from accepting 
incoming connections via the interface I am actually interested in 
(192.168.1.8 in this case).

I am having this problem with CLISP 2.38 on a Windows XP machine. Here 
is an example:

(defun open-server-socket (&key (port +default-port+))
   "Open a server socket to accept incoming connection."
   (let ((server (socket:socket-server port)))
     (format t "~&> Opened server socket on port ~d~%" port)
     (setf *server-socket* server)))

(defun close-server-socket ()
   (socket:socket-server-close *server-socket*)
   (setf *server-socket* nil)
   t)

COMMS> (open-server-socket)
 > Opened server socket on port 30001
#<SOCKET-SERVER 127.0.0.1:30001>
COMMS> (close-server-socket)
T
COMMS>

After the server socket is opened (and before closing it, obviously), I 
can connect from the local machine, but not from other machines on the 
LAN. If I explicitly bind to the desired interface, I get the same thing:

(defun open-server-socket (&key (port +default-port+) (interface 
"192.168.1.8"))
   "Open a server socket to accept incoming connection."
   (let ((server (socket:socket-server port :interface interface)))
     (format t "~&> Opened server socket on port ~d~%" port)
     (setf *server-socket* server)))

COMMS> (open-server-socket)
 > Opened server socket on port 30001
#<SOCKET-SERVER 127.0.0.1:30001>
COMMS>

Other computers still cannot connect. Actually, that is not quite right. 
Another computer can apparently connect (from its point of view), but 
when I try to accept a connection with the following code, in hangs 
forever (despite having taken steps to avoid that!):

(defun maybe-get-connection ()
   "Get a connection if there is one available."
   (when (socket:socket-status *server-socket*)
     (setf *comms-socket* (socket:socket-accept *server-socket* :timeout 
1.0))))


I have eliminated Windows and firewalling issues by (a) turning off 
firewall; and (b) successfully running Python code to do the same thing 
as the above Lisp code.

I have also used CLOCC/port/net.lisp over CLISP and got the same result.

Am I doing something wrong? Does anyone have any ideas as to what the 
problem could be?

Thanks,

David Trudgett

From: Sam Steingold
Subject: Re: CLISP socket binding loopy?
Date: 
Message-ID: <m3bqlridin.fsf@loiso.podval.org>
> * David Trudgett <··········@nncg.arg.nh> [2006-12-26 11:17:19 +1100]:
>
> I am having this problem with CLISP 2.38 on a Windows XP machine.
>    (socket:socket-server port :interface interface)

fixed in 2.39:

* Bug fixes:
  + SOCKET:SOCKET-SERVER :INTERFACE now behaves as documented.


-- 
Sam Steingold (http://sds.podval.org/) on Fedora Core release 6 (Zod)
http://honestreporting.com http://mideasttruth.com http://truepeace.org
http://pmw.org.il http://memri.org http://camera.org http://palestinefacts.org
You can have it good, soon or cheap.  Pick two...
From: David Trudgett
Subject: Re: CLISP socket binding loopy?
Date: 
Message-ID: <emq7am$ged$1@news-02.connect.com.au>
Sam Steingold wrote:
>>* David Trudgett <··········@nncg.arg.nh> [2006-12-26 11:17:19 +1100]:
>>
>>I am having this problem with CLISP 2.38 on a Windows XP machine.
>>   (socket:socket-server port :interface interface)
> 
> 
> fixed in 2.39:
> 
> * Bug fixes:
>   + SOCKET:SOCKET-SERVER :INTERFACE now behaves as documented.
> 
> 

That's great, Sam! Thanks for the quick response. I downloaded 2.41 and 
all works fine now.

David