lö 2006-06-17 klockan 02:23 +0300 skrev Tor Lillqvist:

> I should still of course also investigate why the other (unknown)
> mechanism which causes unregistration to happen anyway on Unix doesn't
> work on Windows...

I think I have a good guess now: The problem is that all sockets by
default are inherited by child processes in Windows. (Like file
descriptors in Unix.) Thus even if the Evolution process, which created
the socket and was listen()ing on it dies, the socket still exists in
LISTENING state as it has been inherited by the processes that Evolution
has started (bonobo-application-server), even though said processes are
blissfully unaware of it... This doesn't happen on Unix because ORBit2
sets FD_CLOEXEC on the sockets it creates. FD_CLOEXEC doesn't exist as
such in Windows, so that code is just ifdeffed out, and I haven't really
much thought about what consequences this might have... until now.

I think it is possible to get the same effect as FD_CLOEXEC, though, by
duplicating the socket using DuplicateHandle() to be non-inheritable,
closing the original, and using the duplicated socket instead. Will have
to try.


Evolution-hackers mailing list

Reply via email to