Hi,
I'm trying to use the posix module, because I need htonl() and ntohl(), but if I import posix (Windows, vcc), I get this error message:
asyncnetcodetest.c(11): fatal error C1083: Cannot open include file: 'arpa/inet.h': No such file or directory
Can I fix this somehow?
Windows isn't POSIX and thus that module does not work on windows.
the nativesockets has htonl and ntohl.
import nativesockets
which is cross-platform and has ntohl/htonl declarations. Also github search in project for htonl/ntohl or any other procedure can help you in future.The first line of posix module paragraph mentions: This is a raw POSIX interface module. So it's obvious a simple ffi for native posix apis.
Also from the module name should be obvious though, on Windows using winlean and unix/linux using posix module
shouldn'd the "import posix" fail on Windows?
No it should not. The posix module is very useful for building custom library wrappers for WINE (which is being compiled with --os:windows via winegcc under linux). So the posix module allows to access underlying linux interfaces.