Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 4th, 2007, 9:12 AM   #1
diablo75
Newbie
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0 diablo75 is on a distinguished road
Need to figure out the best way to confirm a VNC connection...

I (or rather, a friend of mine) have created a little program that, upon clicking a button, sends a command similar to this one:

winvnc -connect dyndns.domain.com:5500

The utility is intended to be used by clients of mine who need tech support and need a simple way to get me connected to their computer.

Right now, this command will run winvnc and send it's little icon to the task bar in the lower right corner by the clock, regardless of whether or not the connection was successful. In addition, I have a timer that appears on the screen with an End Session button below it for easy closure of the program and it's connection to me.

I need to figure out the best way to confirm that the attempted connection brought about by the above command is successful. Upon success, the timer appears. If it's not successful, I'll have a popup that will notify the user, allow them to click Retry, Custom (IP address, if my dyndns service goes down) and finally a cancel button.

How should this be done?
diablo75 is offline   Reply With Quote
Old Nov 4th, 2007, 3:31 PM   #2
Grich
Hobbyist Programmer
 
Grich's Avatar
 
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 165
Rep Power: 1 Grich is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

Could we see the source code of what you have done so far? It might help.
__________________
SYNTAX ERROR ...
Grich is offline   Reply With Quote
Old Nov 4th, 2007, 4:18 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

The source code might be useful, if one is trying to overmanipupulate.

VNC is a program that allows one to control a remote machine by presenting the desktop of the remote machine on the controller's machine, with associated mouse actions and commands being transmitted to the remote machine.

The nature of the beast is that the controlled machine sets itself up as a client while the controlling machine sets itself up as a server. This means that the controlled machine must initiate the contact, and that it will control access by means of a password.

What it is is a free application that performs (if controlled correctly) as a GoToMyPC.

The controlling machine must know the controlled machines IP address. This presents problems when the controlled machine has a dynamic IP, rather than a fixed IP. One solution to this is for both parties to agree to use a dyndns service to stabilize the situation.

I don't see the problem if control of the customer's machine is agreed upon. The client fires up VNC. You fire up VNC. The client gives you a password and their current IP address. You contact. You fix their problem. It's a done deal.

If the client needs help, and you aren't aware of it, perhaps you should check your email or your phone messages. If your client doesn't need help, and you're just trying to access their machine, shame on you.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 4th, 2007, 5:38 PM   #4
diablo75
Newbie
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0 diablo75 is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

Quote:
Originally Posted by DaWei View Post
The controlling machine must know the controlled machines IP address.

This presents problems when the controlled machine has a dynamic IP, rather than a fixed IP. One solution to this is for both parties to agree to use a dyndns service to stabilize the situation.

I don't see the problem if control of the customer's machine is agreed upon. The client fires up VNC. You fire up VNC. The client gives you a password and their current IP address. You contact. You fix their problem. It's a done deal.

If the client needs help, and you aren't aware of it, perhaps you should check your email or your phone messages. If your client doesn't need help, and you're just trying to access their machine, shame on you.
You have the entire process of how the connection actually happens in REVERSE. Literally. Google "Reverse VNC connection."

--------------

After thinking about it for a while, I determined the easiest way to do what I want is to have the program silently run netstat after an attempt to establish the connection occurs and pipe the output through a if>then that basically says, "If you see the phrase "5500 ESTABLISHED" in the piped output from netstat, then the connection has been established successfully; proceed to the next step." Piece of cake.
diablo75 is offline   Reply With Quote
Old Nov 4th, 2007, 5:59 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

No doubt you are correct. It's been 3 years since I used it, and the brain cells don't put off that many sparks, when rubbed together, anymore.

Let me generalize. I used it in a fully cooperative atmosphere. I didn't fire it up unless the clients asked me to. I then required them to give me a current IP (all of them had dynamic IPs), and we set up the passwords. They had the option of terminating the process at any time merely by halting the service.

I felt that if they were in need, they could communicate with me by email or telephone. Usually, we were in contact by telephone at the time the connection was being made. This method totally precludes the necessity of having timers or retries. One just handles it verbally.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 4th, 2007, 8:05 PM   #6
diablo75
Newbie
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0 diablo75 is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

Quote:
Originally Posted by DaWei View Post
No doubt you are correct. It's been 3 years since I used it, and the brain cells don't put off that many sparks, when rubbed together, anymore.

Let me generalize. I used it in a fully cooperative atmosphere. I didn't fire it up unless the clients asked me to. I then required them to give me a current IP (all of them had dynamic IPs), and we set up the passwords. They had the option of terminating the process at any time merely by halting the service.

I felt that if they were in need, they could communicate with me by email or telephone. Usually, we were in contact by telephone at the time the connection was being made. This method totally precludes the necessity of having timers or retries. One just handles it verbally.
Well, the only reason I brought this up is in the event there is some kind of rare network communications issue. I'd wanted to have a backup plan, and I also didn't want the program to appear to be connected when it may not be. I want confirmation, doubling as a mechanism to prevent people from clicking the "Begin Session" button I've made first, instead of clicking the "send message" button to notify me of their need in the first place. Just wanted to make the software idiot proof. I wouldn't be surprised if someone clicked on the "Begin Session" button, and just walked away waiting for me to call them or something.
diablo75 is offline   Reply With Quote
Old Nov 4th, 2007, 9:00 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

Don't blame you, but don't look for idiot proof. Soon as you get there, they'll just make a better idiot.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 4th, 2007, 9:12 PM   #8
diablo75
Newbie
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0 diablo75 is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

Quote:
Originally Posted by DaWei View Post
Don't blame you, but don't look for idiot proof. Soon as you get there, they'll just make a better idiot.
Version numbers are universal, it would seem...
diablo75 is offline   Reply With Quote
Old Nov 4th, 2007, 10:27 PM   #9
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 255
Rep Power: 1 Jabo is on a distinguished road
Re: Need to figure out the best way to confirm a VNC connection...

Whenever I initiate a vnc session, it either connects and puts the desktop in a window for my viewing, or tells me the connection failed. But then, I have my vnc host set to automatically accept requests.
Jabo is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL connection bottleneck? Jimbo Other Web Development Languages 8 Jun 28th, 2006 8:27 PM
SMTPlib - Connection reset by peer Sane Python 2 Jun 20th, 2006 5:40 PM
JDBC DB2 connection Konnor Java 6 Mar 10th, 2006 6:54 PM
Connection Pooling java_roshan Other Web Development Languages 2 Nov 28th, 2005 3:24 PM
connection reset by peer / bad file descriptor opcis Perl 0 Feb 10th, 2005 3:29 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC