[winGRASS] d.mon socket problem
Glynn Clements
glynn.clements at virgin.net
Wed May 21 00:20:10 EDT 2003
Markus Neteler wrote:
> > The problem is not with Grass5; rather with the Cygwin XWin.
>
> I am rather sure that it also appears with the generic driver (without
> Xwin). But as libG11.dll uses some X related code it may be the same
> problem?
No. libG11 implements parts of the Xlib API by calling Windows GDI
functions, whereas the real Xlib works by building X protocol requests
from the functions' arguments and sending them to an X server.
As for the startup message:
> GRASS >d.mon x0
> Socket is already in use or not accepting connections.
> Use d.mon to select a monitor
> Problem selecting x0. Will try once more
This indicates that either:
a) you're using the "generic" version of mon.start, or
b) Cygwin's process management functions are badly broken.
The normal (i.e. Unix) mon.start uses execl() to start the driver, so
the system() call in d.mon won't return until the driver fork()s, and
this doesn't happen until after listen() has been called on the
socket, so the subsequent mon.select is bound to succeed (unless the
driver dies outright).
The "generic" mon.start (i.e. if --enable-w11 was used) uses spawnl()
to start the driver in the background (and passes "-" as argv[2], so
the driver doesn't fork()). spawnl() returns immediately, so the first
time that mon.select is run, the driver probably won't have finished
initialising, so you get the above messages.
If you use the "generic" mon.start with the "real" X11 XDRIVER, you
will get the warning due to the first mon.select attempt failing, but
it should work otherwise (unless the second attempt also fails; note
that there isn't an explicit delay, so this is quite possible).
Given that your symptoms match option a) above, and you imply that you
have both versions of XDRIVER, I'm tempted to suspect that you're
switching between XDRIVER versions without also switching mon.start.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-windows
mailing list