My problem is fairly simple: I wish to send/receive simple commands between two PCs. The first PC (PC1) runs a program that controls and monitors an alarm system. The seconds PC (PC2) is any PC that is connected to the internet and must be able to also control and monitor the alarm system.
A Java program runs on PC1 and this program monitors and controls the alarm. I therefore have to find a way to control this program remotely. I do not want to use remote desktop as I need to limit the amount of data transfer. I just want to be able to send/receive commands to/from PC1. The program on PC2 can either be a stand alone program or a web app. I'm not sure what would be the best/easiest option to implement. Any comments would be appreciated.
So far, I have come up with the following options:
- PC1 acts as a server and opens a socket for the PC2. PC2 connects to the sockets and starts to send commands and then receives responses. I think firewalls and IP addresses can be be a problem
- Create a server program that runs on a server on the internet somewhere. PC1 and PC2 would then be clients that communicate with each other via the server. I think this is the best solution, but I have no idea how to implement this.
- Use Google App Engine as the server and somehow relay information between the two PCs.
I've done a lot of research, bit still I don't know what is the best way to implement this. I am planning on writing the programs in Java. I have good programming experience, but my knowledge regarding networks are very limited. I would also have the add a password to log in and ideally encrypt the transmitted information.
Any comments regarding the above options or any other method to solve my problem would be greatly appreciated.
Thanks