Is it possible to find out if a VNC connection is active - c++

My application is running on windows XP, a VNC server is also running on the PC. I'd like to find out if someone is currently connected to the VNC server (e.g. to use simpler icons). I'm using UltraVNC.
Is there a simple (preferably documented) way to to this?
EDIT: Apparently someone voted to close because he/she thought this belonged on superuser, so I think I should clarify the question: I need a programmatic solution, preferably in .NET or C++. (This is problem is trivial for a user: just look at the VNC icon in the tray.)

You can use netstat to see if there is an established connection on the port your VNC server is listening on.
try netstat -an | find "ESTABLISHED" | find ":5900" on Windows at the command prompt.
There'll be a line entry for it if someone is connected.
Note: If you're connecting to another server then this search will find that connection too, so pay attention to the presence of the :5900 in the second column from the left since this is the local machine.

check the status of port 5900

Related

Raspberry: Qt issue connecting device because SSH client-server capabilities don't match

I'm trying to launch an application in C++ done with QtCreator:
This is the error:
I can see the error if I try to test the connection with created device or calling run on QtCreator.
I don't have any idea how to align capabilities.
Can someone tell me which file I have to modify to fix the issue?
I found some info about "sshd_config" file but I didn't find a way to solve.
I tried to modify the file as suggested, thanks by the way, but with the change the ssh doesn't start at all.
So, I'm sorry for the question but, there is a position defined where I can/should place the suggested line?
This is my file
I tried at the begin, at bottom, in the middle, nothing the connection was refused.
The client is offering a list of broken ciphers. You should consider updating the Qt Craetor or whatever is this software using to connect to the remote device.
The other possibility is to allow these ciphers on the server (device). Add
Ciphers +aes128-cbc
to your /etc/ssh/sshd_config and restart the sshd service. If it will not work, use for example this list:
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc
and restart the sshd service on the device.
I solved adding this string and as I was not sure where apply it, I would like to show exactly which line was added:

Qt::How to identify/detect if the system is Remotely access by other system in Linux

I am developing an application in ubuntu to access the other system remotely through QT. Both system are running some Qt applications.I want to check / make changes to the other system remotely using Qt programming.
I want to add a pushbutton (as a quit screen) at remote system that should be "Enable only if the system is remotely accessed", so that i can use it to close the remote access screen.
Is there any way through programming we can get the status whenvever it is remotely accessed???
I got through some solutions on forum but they are particularly for Windows. I am looking for some solution in Linux.
Please provide suggestion/links so that i can overcome this issue.
Thanks in Advance
If you are using the remote display abilities of the X11 protocol, you could check the value of the DISPLAY variable. For a local connection, it usually starts with :0; for a distant connection, it contains the hostname of the displaying server. For a connection thru ssh -X it could be localhost:10 and ssh is also setting SSH_CLIENT and SSH_CONNECTION environment variables.
Otherwise, you should define better what is a remote access for you (i.e. explain more your application). Your Qt application may also be e.g. some TCP/IP server. Perhaps the getpeername(2) syscall might be relevant.
If you just are interested in what remote connections flow into your box (independently of a particular application) you could read (e.g. using popen) the output of command netstat -a -n or use some /proc/net/ directory.

Using telnet to communicate with QNX Neutrino via TCP/IP in C++

I'm able to access a telnet server via PuTTY which opens a terminal and allows me to send commands to retrieve data/logs and start/stop processes. I'd like to begin some research into how to access this server via C++ in order to automate the connection and the commands for testing. Basically I need a telnet client that can connect and authenticate itself, and write and read to/from the server as if I'm typing in a terminal. Where should I start my research? I've tried a couple examples including:
http://lists.boost.org/boost-users/att-40895/telnet.cpp
When I compile and run
./telnet 192.168.1.26 23
Nothing happens, but when I connect to the server with PuTTY I get:
QNX Neutrino (localhost) (ttyp0)
login: root
password:
#
Any help would be greatly appreciated.
Notes:
- I am using a Mac running OS X Version 10.7.3 with i686-apple-darwin11-llvm-gcc-4.2
- I am allowed to be doing this.
- I use PuTTY on my Windows 7 machine, the connection is ethernet to USB ethernet adapter, and the settings for the Local Area Connection Properties > TCP/IPv4 Properties: are a specific IP address, Subnet Mask, and Default gateway, which might be useful information.
Thanks
Learn how to program TCP/IP sockets. You can use the boost libraries, or straight C style BSD sockets. Some info here, here and here. If paper is your thing, you could get Volume 1 of Unix Network Programming. That book has such a good reputation that you get votes just for mentioning it on StackOverflow.
What you want to do closely matches the functionality of telnet and expect. You can have a look at there sources here and here for ideas.
Consider just using expect to solve your problem :)
You should start by learning the network API for the system you're trying to connect from. Telnet is just sending straight up text through a tcp/ip socket.

Putting wamp online prob

Alright, so I've downloaded wamp server before an hour. I was trying to put it online and I just couldn't. I'm getting the following exception: "could not execute menu item internal error exception could not perform service action". I was googling it and I found 2 solutions.
1 of them is to change the ports of the skype, and other programs from port 80 to another one.
I don't have any of these programs, so it's should be OK.
The second solution is to change the port of the wamp to 8080 or whatever, I tried this also and it's still not working.(The icon of the wamp is orange).
What am I doing wrong? Am I missing anything?
I use WampDeveloper Pro, so it's a bit different, but I'll assume that your problem is that Apache will not start.
You'll need to get the specific Apache error message to understand what the problem is.
Open the command line (run cmd.exe), and within type in: httpd t.
This will perform a syntax check. If it's okay, then type in: httpd -k start.
This will attempt to start Apache, and if unsuccessful, will print out the error.
If the error is something like "can't bind to 0.0.0.0:80, port already in use" (the error will be a bit more clinical than that) then you are right, something else is already taking up port 80.
In which case, type in: netstat -aon. Look for the line that says "0.0.0.0:80" and note the PID number. Then get in your Windows Task Manager (ctrl-alt-del), into the Processes Tab, click "Show process from all". Find the process that has the same PID number. This is what you need to shut down or reconfigure to listen on another port.
hey have you tried to put off any othe installed server like IIS for example ?? if you have IIS turned on go to services and stop world wide publishing service and than try restart all wamp services and then put it online it sould work :)
Mostly its Apache problem.
I had the same problem. The problem is that the port Apache is trying to use is actually being used by some other application. Either
Change the port no. from the file http.conf or httpd.conf from 80 to smething else Listen 8080 change 8080 to something else.
check out which application is using the port and shut it down. Check the port status using "cports" aplication or any other that you prefer. Then it will work just fine.

Several machines running same software, some won't connect to firebird

I'm pretty perplexed... I've got 5 different test computers, all relatively blank Windows XP machines running similar hardware specs. I run a silent install of the FireBird (Classic) database and my application. Some computers require "localhost:" (or 127.0.0.1) before the database location to make a connection, and some simply don't work at all! This is running the exact same software across the board. Does anybody have any suggestions as to what needs to happen to make the connection string universal, or what I could be doing wrong??
It's firebird version 2.1.1.17910 Classic
By the way, i tried connecting to the same database using FlameRobin (a small db management tool) and it worked just fine on the computers that don't connect.
Any more information necessary just let me know! Thanks a lot in advance
For anybody's future reference, the answer is in the services. Apparently it's not being registered as a service for some reason, and on the working computers, was at some point registered, probably through some sort of far earlier tests of Interbase is my best guess.
C:\Windows\System32\drivers\etc and opening up the file 'services' and adding the following line allows the server to run properly.
gds_db 3050/tcp
I'm not sure whether you are aware of that, but a connection string without "localhost:" or "127.0.0.1:" in front of the database name or alias will use the local protocol, which can't be used when connecting to Firebird Classic Server (see this link for more information). If a host name or IP address is given, then TCP port 3050 will be used for the connection.
If you have registered a server in FlameRobin, and did not leave the hostname field in the registration dialog blank, then the host name will be part of the connection string. That would explain why you can connect using FlameRobin.
As for the differences between the machines: You should first go to the Firebird Server Manager applet and make sure that the server is indeed running on all machines, and that the version is the same.
Does it have something to do with the hosts file on some of the computers? Or is that what you're referring to with your
Some computers require "localhost:" (or 127.0.0.1) before the database location...
comment?