How to set a timeout on Vncconnect?

Seak, Teng-Fong tfseak "at" futurmaster.com
Wed May 26 10:44:01 2004


> -----Message d'origine-----
> De : benjamin.sauthier "at" worldonline.fr [mailto:benjamin.sauthier "at" worldonline.fr]
> Envoyi : mercredi 26 mai 2004 05:01
> @ : vnc-list
> Objet : How to set a timeout on Vncconnect?
> 
> Because I'm using xinetd and xdm, each time a user connect through xdm a new vnc server
> will be started. That's why only one client can connect at a time. But then other clients can
> join using vncconnect.

	I call your way of doing it a "passive" one.  If that's really what you're looking for, very well.  But your users can launch a viewer, and before connecting to the vnc server, make sure it's in "shared desktop" mode and in this way a new client won't disconnect existing client.  Or in the server, there is an option to set "permanent" shared mode.  For this, you have to read the doc.

> I managed to solve my problem by writing a python script which is testing port 5500 on the
> computer potentialy runing the listening vncviewer. This is not the best solution but it
> works. If anyone have an idea to improve the solution.
>
> I can not use at and launch vncconnect, because if there is no listening viewer, vncconnect
> freezes everything

	I meant every scheduled job opens one *single* vncconect.  Can't this work?  I don't know much about the syntax of "at", but I suppose there must be a way of configuring a job so that if it doesn't start properly after a certain time, the job is killed.

> Benjamin
> 
> ---------------
> import os,sys
> import socket
> 
> serverHost = '192.168.1.100'
> serverPort = 5500
> command = 'vncconnect'
> 
> 
> sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> 
> try:
>   sockobj.connect((serverHost, serverPort))
>   sockobj.close()
>   os.system('%s %s' % (command,serverHost))
>   sys.exit()
> 
> except:
>   print 'Unable to connect'
>   sys.exit(1)
> -----------------
> 
> 
> ----------------------------
> "Seak, Teng-Fong" <tfseak "at" futurmaster.com> wrote:
> > -----Message d'origine-----
> > De : benjamin.sauthier "at" worldonline.fr [mailto:benjamin.sauthier "at" worldonline.fr]
> > Envoyi : samedi 22 mai 2004 03:16
> > @ : vnc-list
> > Objet : How to set a timeout on Vncconnect?
> >
> > I set on my Linux Debian 3.0 box a system with VNC, xinetd and XDM.
> >
> > Everything works fine.
> >
> > The drawback of this technique is that only on client can connect on a display at a time.
> But
> 
> Not true. It's possible to connect simultaneously several clients/viewers to one single server.
> You have to specify the option that you're using "shared" mode.
> 
> For your next question about timeout, sorry, I don't know. Hope someone else knows the
> answer.
> 
> But I have an idea. Could you write a script to use the "at" command? In this way, I think
> it's the system scheduler's job to run them in different processes.
> 
> Good luck
> 
> > there is a workaround which works fine to connect additional users, which consists in
> using
> > vncconnect. Additional users have vncvie
> er who started a VNC display connects all the other users using vncconnect.
> >
> > That's what I'm doing and it work sfine as well, except that if one of the users is not
> > connected or has not his vncviewer listening then vncconnect hang, everything is blocked.
> > Detaching the process with '&' doesn't work.
> > I tried to wrap vncconnect in a python script and set a time delay before killing the
> process
> > but it doesn't work either.
> >
> > Does anyone has an idea on how to set a timeout on vncconnect?
> >
> > Thanks
> >
> > Benjamin
> >
> >
> > ******ADSL Tiscali, le Haut dibit au meilleur prix ******
> > Avec Tiscali, profitez de l'ADSL au meilleur prix partout en France !
> > Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl
> > Sous riserve d'iligibiliti ` l'ADSL.
> > _______________________________________________
> > VNC-List mailing list
> > VNC-List "at" realvnc.com
> > To remove yourself from the list visit:
> > http://www.realvnc.com/mailman/listinfo/vnc-list
> _______________________________________________
> VNC-List mailing list
> VNC-List "at" realvnc.com
> To remove yourself from the list visit:
> http://www.realvnc.com/mailman/listinfo/vnc-list
> 
> ******ADSL Tiscali, le Haut dibit au meilleur prix ******
> Avec Tiscali, profitez de l'ADSL au meilleur prix partout en France !
> Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl
> Sous riserve d'iligibiliti ` l'ADSL.
> _______________________________________________
> VNC-List mailing list
> VNC-List "at" realvnc.com
> To remove yourself from the list visit:
> http://www.realvnc.com/mailman/listinfo/vnc-list