net-listen

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

net-listen

Post by newdep »

I was wondering if its possible to overrule the 'net-listen 'port so that newlisp
is able to bind also to a specific IP, currently it binds to all Addresses,
which is fine ofcourse. So is an extention like (set 'server (net-listen x.x.x.x 12345)) possible ?

My second question (related indirectly to the above)
is how to replace currenlty the (net-local 'port) , which displays
"0.0.0.0" (nth 0 (net-local port)) with something like "12.12.12.12" (localhost)

A (print (net-lookup (nth 0 (net-local server)))) gives me always 'nil, the
workaround it to place 0.0.0.0 in the /etc/host file.

If a (net-listen 'port) would be able to listen to 'ip the second 0.0.0.0 issue
is automaticly solved.

Just a brain spin...

Norman.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

'net-peer' and 'net-peer' local just return what the socket functions getpeername() and getsockname() supply, but I will look into the first part of your question limiting bind to a specific IP number.

Lutz

Locked