(net-service) on Windows?

Started by kanen, September 19, 2014, 10:34:58 AM

Previous topic - Next topic

kanen

Is it possible to use (net-service) on Windows?



I've tried a few different ways to do this and none of them seem to work properly.



Anyone?
. Kanen Flowers http://kanen.me[/url] .

Lutz

#1
Works for me on Windows XP SP2:



newLISP v.10.6.0 32-bit on Win32 IPv4/6 libffi, options: newlisp -h

> (net-service "http" "tcp")
80
> (net-service "ftp" "tcp")
21
> (net-service 21 "tcp")
"ftp"
> (net-service 80 "tcp")
"http"
>


on Unix it would depend on the textfile /etc/services, perhaps on Windows there is something similar somewhere, perhaps in the registry database? For services not registered it would return nil.