[bind10-dev] WIN32 vs python
Francis Dupont
fdupont at isc.org
Wed Sep 5 22:19:20 UTC 2012
There are some issues with the python code on WIN32 environment:
- of course AF_UNIX sockets and Unix bound auth don't work but
about this python is not different from C++ (nor solutions)
- socket.socketpair doesn't exist in WIN32 (note the system call doesn't
exist, it is not the same problem than inet_pton/inet_ntop which exist
but require a patch in the include file to be compiled in, cf
WIN-NOTES on any WIN32 branch (trac826 or trac2117 today))
There is an implementation in python of socketpair so the problem is solved.
- os.rename() has a different behavior in WIN32 (as it is written in the doc).
The solution is to remove the target before, it looses the atomicity but
it is not possible to keep it, and anyway it is in tests
- alarm() (and SIGALRM) is not supported in WIN32, I can see two ways
to solve its use to cancel blocked I/O: the easiest is to add
timeouts in I/O, the second is to spawn a thread managing the
timeout. I prefer the first when applicable as it never leaves a
looping thread in background.
Note for the alarm() on a forked process the solution is to use the
multiprocessing library which is available on Windows too (i.e.,
someone did the job for us so please not ignore him, or with other
words I suggest to open a ticket asking for a rewrite in a portable style
of src/bin/msgq/tests/msgq_test.py ...)
Regards
Francis Dupont <fdupont at isc.org>
More information about the bind10-dev
mailing list