I personally like the idea (which I use) of a local IP port using a simple message protocol. Your Host Server App opens a listener port on a specified port # using the local IP 127.0.0.1
Your Client App's merely connect to it!
wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99
You're behind the firewall. You're using a Local Host IP, which is specific only to that machine and not seen outside of it. That's why its a local IP such as 192.1.68.#.# makes it available outside that computer on the local network. If you use a global IP, it can be seen outside the firewall (as well as the Local IP) only if the firewall maps the global IP through, or remaps the real global IP to the local IP of that computer.
I'd recommend using an INI file. And use the Local Host IP: 127.0.0.1 as a default. that way if you wanted to, you can easily put both host and client on separate computers, still protected by the firewall. It also allows you to alter your port number for more flexibility. Especially if that port is used by another app.
[COMM]
IP= 127.0.0.1:3000
Service apps can create sockets at any time. Since you're on windows you could use pipes, but I like sockets since they're more portable between operating systems.
You can do the network in various ways. You can send from the client to the host without establishing a connection. You could also do a local multi-cast, or broadcast.
wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99
This all works perfectly fine in an administrative environment - but soon the application will be migrated to a restricted (user) account where the running application (A) does not have the rights to launch application (B) to the necessary work. The solution, have an administrative service (service installed when logged on as admin during software installation), and have this service communicate between (A.exe) and (B.exe)... Let's call the service (C) ...
The solution is for the programs to call win32 api function LogonUser() so that they can inpersonate an Administrative account. I have done that may times and it works well. I stored the account name and encrypted password in the registry, then change that password frequently (such as weekly). The registry entry is initially created during program installation, which is run under an administrative account.
>>Since you're on windows you could use pipes,
Pipes don't work on MS-Windows programs.
If used in a Windows program, the _popen function returns an invalid file pointer that causes the program to stop responding indefinitely. _popen works properly in a console application. To create a Windows application that redirects input and output, see Creating a Child Process with Redirected Input and Output in the Windows SDK.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
In that case, sockets or COM would probably be best.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343