OH!  For you, "active" actually meant "connected", right?  I thought it meant 
if the server is simply running or not.

        The first situation can't help you.  You can't use telnet to check if a 
connection is established.  AFAIK, any IP application, thus in particular VNC server, 
will respond even if a session is established already.  I found that if you do a
netstat -n -a -p tcp
and check if 5900 has the word "ESTABLISHED", that means VNC has at least one open 
session.  I'm not sure if this method is flawless, though.

        Actually, on one hand, if you want to know if a real keyboard is attached but 
VNC is making a virtual keyboard, you could
1) stop winvnc service and do the checking
2) restart winvnc afterwards

        On the other hand, you could connect a new client to a VNC server without the 
previous being rejected, provided you're in "shared" mode.  Read DOC for more info:
http://www.realvnc.com/winvncviewer.html

> -----Message d'origine-----
> De : Mark A. Bertenshaw [mailto:[EMAIL PROTECTED]
> Envoyi : mercredi 2 juin 2004 11:48
> @ : Seak, Teng-Fong
> Objet : RE: Detecting a live VNC session.
> 
> Teng-Fong:
> 
> Thanks for the reply.  First of all: yes.  As to the situation, it is the second.  
> You are correct
> that I can check to see whether the service is running; however, this doesn't mean 
> that it is
> necessary in use.  Actually, the answer to the first situation seems to be 
> appropriate: I'll try
> to do a sockets connection on startup, and if it fails, I know that the session is 
> in use.
> 
> --
> Mark
> 
> -----Original Message-----
> From: Seak, Teng-Fong [mailto:[EMAIL PROTECTED]
> Sent: 02 June 2004 10:27
> To: Mark A. Bertenshaw; [EMAIL PROTECTED]
> Subject: RE: Detecting a live VNC session.
> 
> 
>       I think your last sentence actually is "... the VNC session is active?"
> 
>       The answer to your question depends on where you're.  Are you in one PC and 
> want
> to determine if VNC is active in another?  Or you're in one PC and want to know if 
> VNC is
> active in that SAME PC?
> 
>       For the first, supposing that VNC is listening port 5900, I imagine you could 
> write a
> script to telnet to a host at port 5900 and if you get "RFB 003...", that means VNC 
> is active.
> You could ask webmaster of http://gotomyvnc.com/ to get more details how he does the
> website.
> 
>       For the second, supposing that VNC server is run as service, I imagine you 
> could
> write a script to check if "winvnc" service is started.
> 
> > -----Message d'origine-----
> > De : Mark A. Bertenshaw [mailto:[EMAIL PROTECTED]
> > Envoyi : jeudi 27 mai 2004 20:15
> > @ : [EMAIL PROTECTED]
> > Objet : Detecting a live VNC session.
> >
> > Hi -
> >
> > I am currently working on an application that is designed primarily to
> > access via a touchscreen PC.  However, there are a few configuration
> > options which require a keyboard.  It is possible to detect that a
> > keyboard is connected using WMI.  However, we are hoping not to have
> > to use a separate keyboard, and instead connect to the machine via a
> > network cable, and use VNC to control the current session.
> > Unfortunately, I can't use WMI in this instance (although I was
> > wondering whether VNC uses some sort of virtual keyboard device).  Is
> > there a standard way of determining whether the WMI session is active?
> >
> > --
> > Mark Bertenshaw _______________________________________________
> > VNC-List mailing list
> > [EMAIL PROTECTED]
> > To remove yourself from the list visit:
> > http://www.realvnc.com/mailman/listinfo/vnc-list
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list

Reply via email to