I've been trying to design a program in Java (because I might need to create an app that does the controlling part) with GUI that can run scripts on a few local computers.
It should do the following:
Client: It should just listen for incoming connections, and accept them from a specific port and IP. When a connection is established, wait for instructions. Once a instruction is read, it should run the scripts and notify the server that a script has been launched or not. It should ultimately keep this connections alive for 8 hours and repeat the same process every day.
Server: It should be able to connect to multiple clients, send instructions when needed and log the data (such as name of script, time and if it was successfully launched on the client computer).
Since I'm not an experienced programmer I can't decide if this would be the usual way of doing this.
- Should I create sockets and threads for each instruction which would close after a script has been run. Then create new ones for next the instruction?
- How should I handle disconnects ?
- What should I use to transfer these instruction?
- How should I protect these computers?
I want to also add a way to be able to send data remotely to these computers with new scripts and other files (no more than 50-60 MB).
Ultimately is there a much better way to do this?