| 1 |
|
| 2 |
|
| 3 |
Presently, this directory contains only one example application for |
| 4 |
SPIPEs. The test source code is contained in SPIPE-acceptor.h and |
| 5 |
SPIPE-connector.h. |
| 6 |
|
| 7 |
The SPIPE-acceptor example illustrates how named pipes are used on NT. |
| 8 |
Once the server establishes a connection to a single client, it spawns |
| 9 |
a thread pool to handle incoming requests via the proactor event loop. |
| 10 |
That is, a separate thread from the pool is used to process each |
| 11 |
message sent by a client. The size of the thread pool can be |
| 12 |
specified by command-line arguments. This example leverages the |
| 13 |
queueing performed by the NT kernel to trivially implement a thread |
| 14 |
pool architecture. |
| 15 |
|
| 16 |
test_spipe_acceptor has the following command-line arguments: |
| 17 |
|
| 18 |
test_spipe_acceptor -t <threads> |
| 19 |
|
| 20 |
<threads> specifies the size of the thread-pool running in the |
| 21 |
proactor event loop. |
| 22 |
|
| 23 |
Here's how to run the tests: |
| 24 |
|
| 25 |
% test_spipe_acceptor -t 1000000 |
| 26 |
starting up daemon test_sock_acceptor |
| 27 |
Opening acepipe |
| 28 |
hello |
| 29 |
|
| 30 |
% test_spipe_connector |
| 31 |
starting up daemon test_sock_connector |
| 32 |
Opening acepipe |
| 33 |
activating 5 |
| 34 |
|
| 35 |
please enter input..: hello |
| 36 |
|
| 37 |
There are a number of other options that you can provide. Please see |
| 38 |
the source code for details. |