How to mimic "Add New Client"

Here you will find help for frequently asked questions as well as for your specific question.

How to mimic "Add New Client"

Postby romrom3254 » 2015-06-01 15:10

I'm trying to create a mini-program that starts up a new session, basically an equivalent of selecting "Add new client" by right-clicking the UltraVNC server service. What is the exact command line that "Add New Client" executes? Obviously it includes winvnc -connect, etc. Does it also include the -autoreconnect command? So, to be crystal clear if I set:
Host Name = connectToMe.com
Connection Number = 21
What exact command line will be created when I hit OK?

P.S. I tried to figure it out by downloading the code, but unfortunately I'm not that savvy with C++ programming.
romrom3254
8
8
 
Posts: 8
Joined: 2015-06-01 14:22

Re: How to mimic "Add New Client"

Postby Rudi De Vos » 2015-06-01 16:46

Try

winvnc.exe -connect viewerhost:5500 -run
winvnc" -autoreconnect -connect viewerhost:5500 -run

if port =21

you need to use viewerhost::21 ( ports lower then 1024 require a dubble : )
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5898
Joined: 2004-04-23 10:21

Re: How to mimic "Add New Client"

Postby romrom3254 » 2015-06-01 17:04

Sorry, but which one is it? Does "Add new client" use autoreconnect or not?
Do I need to include the ID with autoreconnect if I use the -id tag anyway?
Also, when would one use -stopreconnect ?
Documentation is, frankly, very confusing
romrom3254
8
8
 
Posts: 8
Joined: 2015-06-01 14:22

Re: How to mimic "Add New Client"

Postby Rudi De Vos » 2015-06-01 19:01

What's confusing
Command line parameters
http://www.uvnc.com/docs/uvnc-server/51 ... eters.html
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5898
Joined: 2004-04-23 10:21

Re: How to mimic "Add New Client"

Postby romrom3254 » 2015-06-02 19:12

Oops, I forgot to mention that I am using the repeater service.
The documentation doesn't really state how these commands are affected when you do repeater vs. a listening viewer.

I have a few issues with the documentation, but it could just be due to my ignorance of how UVNC works:

First, the documentation page shows the following parameters:
winvnc [-sc_promt] [-sc_exit] [-id:????] [-autoreconnect[ ID:????]] [-connect host[:port]] [-connect host[::port]] [-run]

Whereas the command "winvnc -?" tells a different story:
winvnc [-sc_promt] [-sc_exit] [-id:????] [-stopreconnect][-autoreconnect[ ID:????]] [-connect host[:display]] [-connect host[::port]] [-repeater host[:port]] [-run]

Note that the former has no mention of stopreconnect and repeater tags and excludes the word "display". Which version is correct?

How is "stopreconnect" used exactly? How can I stop the server from connnecting with autoreconnect?

How do I force a connetion closed? Kill it? I don't want to close the service for good, just the active connection.

What is the "id" tag used for? Why is there a separate id qualifier for the "autoreconnect" tag?

Also, what is the point of the "-run" tag exactly? I understand that it signals the final tag, but does it make any difference if it is ommitted?

It would be nice if there were some more examples
romrom3254
8
8
 
Posts: 8
Joined: 2015-06-01 14:22

Re: How to mimic "Add New Client"

Postby Rudi De Vos » 2015-06-02 22:09

1) NO repeater
winvnc running as application
run
vncviewer -listen
winvnc.exe -connect localhost -run
without -run it doesn't do anything

winvnc running as service
vncviewer - listen
winvnc.exe -connect localhost -run
This give an error, winvnc is already running because the -run try to start another winvnc
winvnc.exe -connect localhost
This is correct, but in both cases the service get the injected command

winvnc.exe -autoreconnect -connect localhost
If you close the viewer, the server restart the connect
winvnc.exe -stopreconnect
This tell the service to disable the -autoreconnect
closing viewer now stop connection

Runing as service you also can add ultravnc.ini
[ultravnc]
service_commandline=-autoreconnect -connect localhost
Now the service try reconnect after reboot, no manual handling needed

2) Repeater
winvnc -> connect to repeater
vncviewer -> connect to repeater
ID: repeater link the server and viewer with the same ID
You can have multi servers with different ID waiting, the ID act as name at repeater level

vncviewer.exe -proxy repeaterip:5901 ID:12345
winvnc -id 12345 -connect repeaterip:5500
winvnc -autoreconnect ID:12345 -connect repeaterip:5500

force closed, not possible
you can only restart the service
net stop uvnc_service
net start uvnc_service
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5898
Joined: 2004-04-23 10:21

Re: How to mimic "Add New Client"

Postby romrom3254 » 2019-05-02 21:56

I know this is an old post, but I still didn't have any luck getting this to work and I'm revisting this after giving up a few years back. This is my issue: If I go to the host computer (where the server is), right click on the tray icon, select "Add New Client" and enter "myhostname.com" for the "Host Name" and 21 for the connection # then I'm able to connect without any issues whatsoever. However, I'm trying to mimic this functionality by calling winvnc using another application that I created (to make it easier for the user so they don't need to type in my host name every time). I'm calling the following command line from my program:
winvnc -connect myhostname.com::9177 -id:21
However this doesn't work (it just ignores me). Am I doing something wrong? If I add the tag "-run" then it tells me that another instance is already running. HELP!
romrom3254
8
8
 
Posts: 8
Joined: 2015-06-01 14:22


Return to General help

Who is online

Users browsing this forum: No registered users and 8 guests

cron