| 1 |
|
| 2 |
|
| 3 |
This code illustrates how to write a single set of source code (for a |
| 4 |
client and server) and then parameterize in the desired IPC mechanism. |
| 5 |
In this case, the IPC mechanisms include sockets, TLI, and STREAM |
| 6 |
pipes. The single set of source code is located in CPP-acceptor.cpp |
| 7 |
(which is the server) and CPP-connector.cpp (which is the non-blocking |
| 8 |
client). |
| 9 |
|
| 10 |
Here's how I typically run these tests: |
| 11 |
|
| 12 |
% test_sock_acceptor localhost:10020 & |
| 13 |
starting up daemon ./test_sock_acceptor |
| 14 |
starting server addr 127.0.0.1:10020 on handle 5 |
| 15 |
client addr 127.0.0.1:10003 on handle 6 |
| 16 |
hello |
| 17 |
|
| 18 |
% test_sock_connector localhost:10020 |
| 19 |
starting up daemon ./test_sock_connector |
| 20 |
activating 5 |
| 21 |
in handle_output |
| 22 |
please enter input..: hello |
| 23 |
in handle_output |
| 24 |
|
| 25 |
There are a number of other options that you can provide. Please see |
| 26 |
the source code for details. |
| 27 |
|
| 28 |
Note that only the sock tests work on all platforms. The other tests |
| 29 |
reply on features (in particular, non-blocking connections and TLI) |
| 30 |
that are mostly found on UNIX platforms. |