... | ... | @@ -12,7 +12,8 @@ $ export PATH=build/examples/cpp:$PATH |
|
|
If necessary, set the *PYTHONPATH* variable so that the *cameopy* module is found.
|
|
|
The path is dependent on the system e.g.:
|
|
|
```
|
|
|
$ export PYTHONPATH=<cameo-build-path>/lib/python3/dist-packages:$PYTHONPATH
|
|
|
$ export CAMEO_PATH=<cameo-install-path>
|
|
|
$ export PYTHONPATH=$CAMEO_PATH/lib/python3/dist-packages:$PYTHONPATH
|
|
|
```
|
|
|
|
|
|
Select *jzmq* **or** *jeromq* Java library.
|
... | ... | @@ -26,6 +27,10 @@ You shall define the variable *LD_LIBRARY_PATH* so that *libjzmq.so* is found: |
|
|
```
|
|
|
$ export LD_LIBRARY_PATH=<path-to-libjzmq>
|
|
|
```
|
|
|
Start the cameo server with the examples configuration:
|
|
|
```
|
|
|
$ java fr.ill.ics.cameo.server.Server examples/config.xml --log-console
|
|
|
```
|
|
|
|
|
|
In each new shell, create the alias for *cmo*:
|
|
|
```
|
... | ... | @@ -42,57 +47,71 @@ In each new shell, create the alias for *cmo*: |
|
|
$ alias cmo="java -jar java/console/target/cameo-console-2.2.0-full.jar"
|
|
|
```
|
|
|
|
|
|
|
|
|
# Requester/Responder
|
|
|
|
|
|
## Java
|
|
|
|
|
|
The requester/responder in Java can be tested. First start the Cameo server:
|
|
|
```
|
|
|
$ java fr.ill.ics.cameo.server.Server examples/java/config.xml --log-console
|
|
|
```
|
|
|
Then start the responder in a new shell:
|
|
|
The requester/responder in Java can be tested.
|
|
|
|
|
|
Start the responder app in a new shell:
|
|
|
```
|
|
|
$ cmo -p 10000 exec responder
|
|
|
$ cmo -p 11000 exec responder-java
|
|
|
```
|
|
|
Execute a requester in a new shell:
|
|
|
Execute the requester app in a new shell:
|
|
|
```
|
|
|
$ cmo -p 10000 exec requester my-request 10
|
|
|
$ cmo -p 11000 exec requester-java tcp://localhost:11000 java "a message" 10
|
|
|
```
|
|
|
The requester app is sending 10 requests to the responder, receives the responses and then stops. Notice that the responder app also stops. Indeed the requester app stops itself the responder app.
|
|
|
|
|
|
Now relaunch the requester app without relaunching the responder app. The requester app is also sending and receiving messages from the responder app. Indeed the responder app has been started by the requester app because it was not running.
|
|
|
|
|
|
|
|
|
## C++
|
|
|
|
|
|
The requester/responder in C++ can be tested. First start the Cameo server:
|
|
|
The requester/responder in C++ can be tested in the same way by replacing *java* with *cpp*.
|
|
|
Start the responder in a shell:
|
|
|
```
|
|
|
$ java fr.ill.ics.cameo.server.Server examples/cpp/config.xml --log-console
|
|
|
$ cmo -p 11000 exec responder-cpp
|
|
|
```
|
|
|
Then start the responder in a new shell:
|
|
|
Execute the requester app in a new shell:
|
|
|
```
|
|
|
$ cmo -p 10000 exec responder
|
|
|
$ cmo -p 11000 exec requester-cpp tcp://localhost:11000 cpp "a message" 10
|
|
|
```
|
|
|
Execute a requester in a new shell:
|
|
|
Same comments as for Java.
|
|
|
|
|
|
|
|
|
## Python
|
|
|
|
|
|
The requester/responder in Python can be tested in the same way by replacing *cpp* with *python*.
|
|
|
Start the responder in a shell:
|
|
|
```
|
|
|
$ cmo -p 10000 exec requester my-request 10
|
|
|
$ cmo -p 11000 exec responder-python
|
|
|
```
|
|
|
Execute the requester with the Java responder:
|
|
|
Execute the requester app in a new shell:
|
|
|
```
|
|
|
$ cmo -p 10000 exec requester my-request 10 tcp://localhost:10000
|
|
|
$ cmo -p 11000 exec requester-python tcp://localhost:11000 python "a message" 10
|
|
|
```
|
|
|
Same comments as for Java.
|
|
|
|
|
|
## Python
|
|
|
## Mixing languages
|
|
|
|
|
|
First start the Cameo server:
|
|
|
```
|
|
|
$ java fr.ill.ics.cameo.server.Server examples/python/config.xml --log-console
|
|
|
You can mix the langagues e.g. *cpp* with *python*:
|
|
|
```
|
|
|
In a shell, start the *responderpy* test:
|
|
|
$ cmo -p 11000 exec requester-python tcp://localhost:11000 cpp "a message" 10
|
|
|
```
|
|
|
$ cmo -p 10000 exec responderpy
|
|
|
```
|
|
|
In a shell, start the *requesterpy* application:
|
|
|
|
|
|
## Remote execution
|
|
|
|
|
|
You can also execute the last example in three different computers:
|
|
|
|
|
|
```
|
|
|
$ cmo -p 10000 exec requesterpy 1000
|
|
|
$ cmo -e tcp://computer-a:11000 exec requester-python tcp://computer-b:11000 cpp "a message" 10
|
|
|
```
|
|
|
|
|
|
The console *cmo* application is executing *requester-python* on *computer-a* which interacts with *responder-cpp* executing on *computer-b*.
|
|
|
|
|
|
|
|
|
|
|
|
# Publisher/Subscriber
|
|
|
|
... | ... | |