I am following networking tutorial series and I need to run both Server and Client projects. When I click ServerProject->Debug->Start New Instance everything is fine, but the option becomes unavailable for ClientProject while Server is running. How can I enable this option and run them both? There is also a third project with winsock stuff set as Startup Project and both Server and Client depend on it.
I have two separate c++ applications (running on Windows 10) that need to communicate with each other on multiple UDP ports. Both applications are running on one machine so I am just using the localhost IP on both ends. The first application is a robust control program that generates a lot of data that is sent out on these ports. The second application is a basic server that is designed to receive and process all this message traffic and occasionally send commands back to the first application.
When running in Visual Studio everything works as expected however running from the command line or a bash script my server app receives all the data as expected, but I cannot sending data to the control app.
I have tried tweaking the Windows Defender and symantic settings with no luck. Is it possible something else is blocking communication only in one direction? And why does it work in the Visual Studio debugger but not when running the executables from the command line?
I am doing this sample https://msdn.microsoft.com/en-us/library/windows/desktop/ms737889(v=vs.85).aspx that contains a C++ tutorial for client and server with Winsock. To run this the server must be run before the client, obviously, but how to debug these things. I mean when I start the server and put a breakpoint in the main function it executes, but when I do this in the client I want to see the interraction with the server code from its solution. Im confused. Is there an article describing this?
I want to run Linux command remotely from Window based Qt C++ application programmatically. What is the simpliest way to do it?
You need some sort of server on the Linux machine and your Windows machine will be a client. I'd say the easiest way would be just make a php script to run your command and drop it in your www root and have your Windows machine fetch that URL.
At the end of the day, without knowing what your requirements are with regard to security and with regard to what kind of commands you'll be running is, it's very difficult to give a definitive answer to this question.
Simply connect to telnet server on the linux using sockets, and send the commands.
This actually requires very little code. Check the Java version here:
Sending telnet commands and reading the response with Java
You can do similarly with Qt/C++ as well.
Simple server-side program witch will handle the requests and then using ex system() function will be this "remotely" part of solution.
And on client-side simple text field handled by function witch will be able to connect to server to send command run request.
The most important thing in this solution will be to take care about security.
One way to do it is, to have a client-server model, the server resides in linux and client can be your computer. That way you can send commands to the server and have its output thrown at you. That's one way I think of this problem.
Use UPnP to get past the firewall(or use NAT traversal or UDP/TCP hole punching). Otherwise (without forwarding the port) it would be impossible to reach the server.
The second is to write your own RSH and SSH utility. (or use putty or other pre-existing software)
You could use Plink if you are on Windows whatever version. If you can run PuTTY, then you can run PLink. PuTTY Plink Documentation. Using that you could use the executable, and automate things. Otherwise, if you're looking for a specific programming language, they'd still be dependent upon some SSH Library. If you're writing your own installer, you could include the PLink.exe in your installer, and distribute it with your application.
From the documentation page:
Z:\sysosd>plink login.example.com 'echo "Hello World"'
What are the ways to run .exe binary of a remote server on the remote server from a c++ application in windows platform??
Open a telnet session to the server, start binary.
open a telnet session (like MSalters suggests), or write a small server app that will run on the remote server, and listen for your its mother application's request to run that ".exe binary".
What you are doing sounds exactly like what psexec already does. So you could either shell out to that or re-implement how it works. There are some descriptions of what it actually does:
http://windowsitpro.com/article/articleid/42919/psexec.html (I believe I read this in the past, but it's behind a paywall now)
http://www.ntkernel.com/w&p.php?id=15