Go to file
xdrm-brackets 5aeaab0bc5 Now 'master' have a main 'input' for all port responses + now all seem to work each time .. (+fixed some minor things) 2018-02-01 16:06:40 +01:00
.gitignore Updated config to /config/$1 instead of /config_$1 + added .gitignore for /config 2018-01-29 13:33:47 +01:00
README.md Added README.md 2018-01-27 19:09:31 +01:00
bind-input minmod 2018-02-01 13:34:36 +01:00
bind-output UPD: bind-input/output now synchronous for the setup, then asynchronous (so the buffer file will always be ok) 2018-02-01 00:28:32 +01:00
master Now 'master' have a main 'input' for all port responses + now all seem to work each time .. (+fixed some minor things) 2018-02-01 16:06:40 +01:00
pool Now 'master' have a main 'input' for all port responses + now all seem to work each time .. (+fixed some minor things) 2018-02-01 16:06:40 +01:00
read removed useless 'launch' script + updated 'read'/'write' for new buffer file structure 2018-01-30 17:02:51 +01:00
write removed useless 'launch' script + updated 'read'/'write' for new buffer file structure 2018-01-30 17:02:51 +01:00

README.md

Exemple

2 machines (A and B) want to share an INPUT/OUTPUT communication in bash.

  • Machine B: 10.10.10.10 port 1111
  • Machine A: 20.20.20.20 port 2222

On machine B

First of all because each machine will launch a client and a server, because of cyclic-redondency, we have to synchronise them so that the clients are connected after the 2 servers.

We can use the 'trigger' to do such synchronisation. It waits until it receives (through a choosen port) a message from machine A.

./trigger 9999; ./launch machineB 20.20.20.20 2222 1111

So we are listening on port 9999 waiting for machine A to tell us when to start.

The arguments can be read through this sentence "I will connect to 20.20.20.20 at port 2222 and my port 1111 is available."

On machine A

You can notice that it is the reverse command from machine B, but we have to launch the trigger instead of waiting for it. The last optional parameter of 'launch' is made for that purpose.

./launch machineA 10.10.10.10 1111 2222 9999;

Now the server will start as expected and stop the 'trigger' command on machine B so it will also launch the server on it. After a delay of 2 seconds, the 2 servers might be connected to each other.

Send a message

./write {sender_machine} "some_message\n";

Read messages

./read {sender_machine};

Note: After a 'read' call, the buffer will be flushed (reading = consuming).