Re: fast way to check local X is running

2003-06-05 Thread Jeremy Wilkins
How about

ps -ax | X

to find out if X is running, if it is

xdpyinfo | grep number of screens: 2

or similar (not sure on syntax).

This should be quite quick because it wont wait for any timeouts.

jeb

Andriy Rysin wrote:
-display :0.1 and -display unix:0.1 both give 6 sec.

Andriy

Alan Coopersmith wrote:

Try -display :0.1 or -display unix:0.1

-Alan Coopersmith-  [EMAIL PROTECTED]
 Sun Microsystems, Inc. - Sun Software Group
 Quality / User Experience (QUE)   -   Globalization
 Platform Globalization Engineering: X11 Development
Andriy Rysin wrote:

Just found that if I use 'localhost:0.1' form, XOpenDisplay tries to 
connect with TCP stream, while if DISPLAY is NULL it choses fastest 
method it can find.
And actually running just 'xlsfonts' with X down gives error right 
away. The problem is that I have to check for screen 0.1.
Is there any way to use XOpenDisplay specifying screen 0.1 without 
forcing it to TCP mode?

Thanks,
Andriy
Andriy Rysin wrote:

I've got a server program trying to connect to local X server on
command. If X runs everything is fine but if not timeout for
XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
localhost:0.1' when X server is down and got about 6 sec delay. It's
probably reasonable for remote X server because of network delays but
for localhost there is probably a faster way. Delay is crucial in my
case - I need to know if X is down in less than 2 sec, is there any 
mean
to know really quick if local server is down?

Thanks in advance,
Andriy
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel






___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel




___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel



___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


fast way to check local X is running

2003-06-05 Thread Andriy Rysin
I've got a server program trying to connect to local X server on
command. If X runs everything is fine but if not timeout for
XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
localhost:0.1' when X server is down and got about 6 sec delay. It's
probably reasonable for remote X server because of network delays but
for localhost there is probably a faster way. Delay is crucial in my
case - I need to know if X is down in less than 2 sec, is there any mean
to know really quick if local server is down?
Thanks in advance,
Andriy
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: fast way to check local X is running

2003-06-05 Thread ilya
ps -ax|grep XFree86

On Wed, Jun 04, 2003 at 01:20:08PM -0700, Andriy Rysin wrote:
 I've got a server program trying to connect to local X server on
 command. If X runs everything is fine but if not timeout for
 XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
 localhost:0.1' when X server is down and got about 6 sec delay. It's
 probably reasonable for remote X server because of network delays but
 for localhost there is probably a faster way. Delay is crucial in my
 case - I need to know if X is down in less than 2 sec, is there any mean
 to know really quick if local server is down?
 
 Thanks in advance,
 Andriy
 
 
 ___
 Devel mailing list
 [EMAIL PROTECTED]
 http://XFree86.Org/mailman/listinfo/devel


pgp0.pgp
Description: PGP signature


Re: fast way to check local X is running

2003-06-05 Thread Andriy Rysin
Just found that if I use 'localhost:0.1' form, XOpenDisplay tries to 
connect with TCP stream, while if DISPLAY is NULL it choses fastest 
method it can find.
And actually running just 'xlsfonts' with X down gives error right away. 
The problem is that I have to check for screen 0.1.
Is there any way to use XOpenDisplay specifying screen 0.1 without 
forcing it to TCP mode?

Thanks,
Andriy
Andriy Rysin wrote:

I've got a server program trying to connect to local X server on
command. If X runs everything is fine but if not timeout for
XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
localhost:0.1' when X server is down and got about 6 sec delay. It's
probably reasonable for remote X server because of network delays but
for localhost there is probably a faster way. Delay is crucial in my
case - I need to know if X is down in less than 2 sec, is there any mean
to know really quick if local server is down?
Thanks in advance,
Andriy
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: fast way to check local X is running

2003-06-05 Thread Andriy Rysin
A bit ugly but the case is even not that :) - I have to check for screen 
0.1 (tv output in my case) and ps -ax will not give me that information.

Andriy

[EMAIL PROTECTED] wrote:

ps -ax|grep XFree86

On Wed, Jun 04, 2003 at 01:20:08PM -0700, Andriy Rysin wrote:
 

I've got a server program trying to connect to local X server on
command. If X runs everything is fine but if not timeout for
XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
localhost:0.1' when X server is down and got about 6 sec delay. It's
probably reasonable for remote X server because of network delays but
for localhost there is probably a faster way. Delay is crucial in my
case - I need to know if X is down in less than 2 sec, is there any mean
to know really quick if local server is down?
Thanks in advance,
Andriy
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/deve
l
 



___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: fast way to check local X is running

2003-06-05 Thread Harold L Hunt II
Specify :0.1 (note: no hostname) as the DISPLAY.  That will use UNIX 
domain sockets, which I am assuming that X using when you pass NULL.

Harold

Andriy Rysin wrote:

Just found that if I use 'localhost:0.1' form, XOpenDisplay tries to 
connect with TCP stream, while if DISPLAY is NULL it choses fastest 
method it can find.
And actually running just 'xlsfonts' with X down gives error right away. 
The problem is that I have to check for screen 0.1.
Is there any way to use XOpenDisplay specifying screen 0.1 without 
forcing it to TCP mode?

Thanks,
Andriy
Andriy Rysin wrote:

I've got a server program trying to connect to local X server on
command. If X runs everything is fine but if not timeout for
XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
localhost:0.1' when X server is down and got about 6 sec delay. It's
probably reasonable for remote X server because of network delays but
for localhost there is probably a faster way. Delay is crucial in my
case - I need to know if X is down in less than 2 sec, is there any mean
to know really quick if local server is down?
Thanks in advance,
Andriy
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel




___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: fast way to check local X is running

2003-06-05 Thread Andriy Rysin
I tried that, the delay is the same as with 'localhost:0.1' ~6 sec. Man 
page says

  If the hostname is a host
  machine name and a single colon (:) separates the hostname and 
display
  number, XOpenDisplay connects using TCP streams.  If the hostname is
  not specified, Xlib uses whatever it believes is the fastest 
transport.
  If the hostname is a host machine name and a double colon (::) sepa-
  rates the hostname and display number, XOpenDisplay connects 
using DEC-
  net.

So it's supposed to be 'fastest transport' when no hostname is specified 
but from the other side it says that colon ':' specifes TCP (and '::' 
specifies DECnet). So there's some ambiguity here.

Andriy

Harold L Hunt II wrote:

Specify :0.1 (note: no hostname) as the DISPLAY.  That will use UNIX 
domain sockets, which I am assuming that X using when you pass NULL.

Harold

Andriy Rysin wrote:

Just found that if I use 'localhost:0.1' form, XOpenDisplay tries to 
connect with TCP stream, while if DISPLAY is NULL it choses fastest 
method it can find.
And actually running just 'xlsfonts' with X down gives error right 
away. The problem is that I have to check for screen 0.1.
Is there any way to use XOpenDisplay specifying screen 0.1 without 
forcing it to TCP mode?

Thanks,
Andriy
Andriy Rysin wrote:

I've got a server program trying to connect to local X server on
command. If X runs everything is fine but if not timeout for
XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
localhost:0.1' when X server is down and got about 6 sec delay. It's
probably reasonable for remote X server because of network delays but
for localhost there is probably a faster way. Delay is crucial in my
case - I need to know if X is down in less than 2 sec, is there any 
mean
to know really quick if local server is down?

Thanks in advance,
Andriy
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel




___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: fast way to check local X is running

2003-06-05 Thread Andriy Rysin
-display :0.1 and -display unix:0.1 both give 6 sec.

Andriy

Alan Coopersmith wrote:

Try -display :0.1 or -display unix:0.1

-Alan Coopersmith-  [EMAIL PROTECTED]
 Sun Microsystems, Inc. - Sun Software Group
 Quality / User Experience (QUE)   -   Globalization
 Platform Globalization Engineering: X11 Development
Andriy Rysin wrote:

Just found that if I use 'localhost:0.1' form, XOpenDisplay tries to 
connect with TCP stream, while if DISPLAY is NULL it choses fastest 
method it can find.
And actually running just 'xlsfonts' with X down gives error right 
away. The problem is that I have to check for screen 0.1.
Is there any way to use XOpenDisplay specifying screen 0.1 without 
forcing it to TCP mode?

Thanks,
Andriy
Andriy Rysin wrote:

I've got a server program trying to connect to local X server on
command. If X runs everything is fine but if not timeout for
XOpenDisplay is pretty long. I tried to run 'xlsfonts -display
localhost:0.1' when X server is down and got about 6 sec delay. It's
probably reasonable for remote X server because of network delays but
for localhost there is probably a faster way. Delay is crucial in my
case - I need to know if X is down in less than 2 sec, is there any 
mean
to know really quick if local server is down?

Thanks in advance,
Andriy
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel




___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel