[GRASS5] GRASS 5 and sockets: default?

Markus Neteler neteler at geog.uni-hannover.de
Wed Feb 21 05:14:06 EST 2001


Hi Eric and Justin,

On Wed, Feb 21, 2001 at 01:59:27PM +0700, Justin Hickey wrote:
> Hi Markus, Eric
> 
> Markus Neteler wrote:
> > > Well, for some reason I see tcltkgrass has a "d.mon start=$mon" 
> > > followed by a "d.mon stop=$mon".  I'm not sure why it's set-up like
> > > this...
> > >
> > > In src/tcltkgrass/main/gui.tcl:
> > >
> > > proc stop_monitors {} {
> > >     foreach monitor [search_xdrivers] {
> > >         exec d.mon start=$monitor >& /dev/null
> > >         exec d.mon stop=$monitor >& /dev/null
> > >         script_add "d.mon start=$monitor >& /dev/null" "cmd"
> > >         script_add "d.mon stop=$monitor >& /dev/null" "cmd"
> > >     }
> > > }
> > >
> > > Since it's run without a controlling tty, and the monitor is already
> > > running when d.mon is asked to start it again, you get an error 
> > > message in your mailbox from d.mon...
> > >
> > > Anybody want to hit me with a clue stick as to why tcltkgrass would
> > > first try to start the monitor? only to kill it?
> > 
> > Eric,
> > 
> > just guessing:
> > 
> > In case you have running x3 only, the "for" loop would try to
> > close x0 (crash), x1 (crash), x2 (crash), x3 (o.k.) etc.
> > As d.mon -L is running now, we could use this to find the
> > running monitors. d.mon -L was failing with fifos (at least on Linux).
> 
> Well I looked at the code and the search_xdrivers procedures is a list
> of monitors that are currently open, based on a call to "xlsclients -l".
> Thus, this list should only contain monitors that are open, unless for
> some reason, the connection (socket, fifo, ipc) was closed and the
> window was left open. Therefore, I don't see any reason for the start
> commands and I think it should be changed to
> 
> proc stop_monitors {} {
>     foreach monitor [search_xdrivers] {
>         exec d.mon stop=$monitor >& /dev/null
>         script_add "d.mon stop=$monitor >& /dev/null" "cmd"
>     }
> }

Nice idea. Works for me with sockets.

> This seems to work on my machine using sockets. The "close all x
> monitors" option for quit worked well, but the
> Config->Monitors->stop->x0 menu option seemed to take a long time. 
Here as well.

>Of  course this change is also necessary for the stop_monitor procedure.
> 
> Anyway, what do you think?

Eric, I have the problem that the sockets are freed:

d.mon x4
Can't bind to socket for monitor <x4>. Already in use?
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
Problem selecting x4. Will try once more
Socket is already in use or not accepting connections.
Use d.mon to select a monitor

d.mon stop=x4
Error - Monitor 'x4' was not running

How to get them back? It seems to be related to my tcltkgrass experiments.

Markus

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list