Fri 19 Nov 2004 12:43:13 PM UTC, original submission:
Under windows 2003 server it distributed objects do not work.
The reason is that apparently the winsock semantics have
changed slightly.
The following happens.
1 - Application registers connection with gdomap
2 - Another application inquires about the connection
3 - gdomap checks if the connection is still alive
by trying to bind a socket on the same address
as the original connection.
Now it used to be that this fails, (so
gdomap knows the connection is still valid)
but on windows 2003 server the binding succeed,
so gdomap thinks the connection is gone and
will remove the connection from its connection map.
After looking at the gdomap code there was a curious
comment just above the aforementioned check.
/* FIXME: This must not be INADDR_ANY on Win,
otherwise the system will try to bind on any of
the local addresses (including 127.0.0.1), which
works. - bjoern */
sa.sin_addr.s_addr = addr[0].s_addr;
After removing this MINGW specific hack everything seems
to work fine. However I assume bjoern added
this for a reasion, so I very hesitant to apply this fix.
If anyone can shed some light on this, please go ahead.
Oh, the attached program gso2.c will demonstrate this
behaviour.
1 - compile with:
gcc -o gso2 gso2.c -lwsock32
2 - Run in one command prompt:
gso2 localhost
3 - Run in another comamnd prompt:
gso2 localhost
The second gso2 invocation will tell on windows2000
that it can not bind the socket, but on windows2003 server
it will bind to the socket.
Also I attach the patch that removes the MINGW code
and seems to fix the problem.
Wim Oudshoorn.
Wim Oudshoorn.
|