2

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?

  • What you describe is often called "infrastructure orchestration". What are those computers you need to control? For some cases, there are solutions which may help you, like ansible.com and such – scriptin Jun 4 '16 at 8:58
  • They are just basically a couple of headless pc's in a gamezone connected to VR glasses. Im mostly trying to build this to have a nice GUI for workers to show different games(little snippet videos) and be able to click on them to start them, preferably on a tablet. – Dangz1 Jun 4 '16 at 16:09
  • Could you use web notifications? – Prasanna K Rao Sep 9 '16 at 6:46
1

An alternative approach may be, to make a simple manager web app and run it on a local web server. As it's a web app, it can be accessed from a tablet, pc, phone or whatever.

Admins (workers) select which computer should play which video, from the manager web app's gui. Client apps check the web app periodically (say once every 5 seconds) too see if something is told them to play. After clients done playing, they report it to server (web app). For the files and scripts, you put them on server, and clients check for files like they check for commands, and download whatever is required from the server.

Or use websockets, and eliminate the need of continuous polling.

This approach may require more programming knowledge and more coding than sockets, but sockets require more management, such as managing IP addresses and ports of every client.

In the end both approaches are doable and feasible I think, but better yet, there may be some readily built products that can satisfy your needs.

(Windows play to feature or something similar maybe a help: http://windows.microsoft.com/en-us/windows7/using-the-play-to-feature-to-stream-media)

  • +1 OP has inverted the roles of clients and server. In his proposed solution server connects to clients instead of the other way around. – Tulains Córdova Sep 9 '16 at 2:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.