newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: kanen on September 19, 2014, 10:34:58 AM

Title: (net-service) on Windows?
Post by: kanen on September 19, 2014, 10:34:58 AM
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?
Title: Re: (net-service) on Windows?
Post by: Lutz on September 19, 2014, 11:55:33 AM
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.