net-listen

Started by newdep, February 25, 2004, 11:27:07 AM

Previous topic - Next topic

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.
-- (define? (Cornflakes))

Lutz

#1
'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