Name Date Size #Lines LOC

..22-Jun-2019-

test/H22-Jun-2019-

Protocol.cH A D20-Aug-20194.4 KiB15086

Protocol.hH A D22-Jun-20191.3 KiB4918

README.txtH A D22-Jun-20191.7 KiB5340

TxnSM.cH A D20-Aug-201932.7 KiB999661

TxnSM.hH A D22-Jun-20192.2 KiB8141

README.txt

1
2Protocol plugin example for SDK 3.0
3
4List of files
5-------------
6
7 - Protocol.c : Accept client requests and generate transaction state machines for each client request.
8 - TxnSM.c    : Implementation of handling a transaction.
9
10 - Protocol.h : Header file.
11 - TxnSM.h    : Header file.
12
13 - test/ProtocolServerTest.java : Synthetic server.
14 - test/ProtocolClientTest.java : Synthetic client.
15 - test/file_gen.sh : shell script to generate file list for testing.
16
17Protocol
18--------
19
20 - Request  : [server_name][space][file_name][space][\r\n]
21 - Response : File (if file is found)
22              Nothing (if file is not found)
23
24How to run proxy
25----------------
26
27 - Compile protocol.so and copy it under plugins directory.
28 - In plugin.config:
29   protocol.so <accept_port> <server_port>
30   accept_port is the port to listen to client requests.
31   server_port is the port to connect to origin server.
32 - Debug tag: -T"protocol".
33
34How to run synthetic server
35---------------------------
36
37 - Compile ProtocolServerTest.java and get ProtocolServerTest.class.
38 - Run: java ProtocolServerTest <server_port>
39   server_port is the port synthetic server listens to requests.
40   server_port should match "server_port" argument passed to the plugin.
41
42How to run synthetic client
43---------------------------
44 - Compile ProtocolClientTest.java and get ProtocolClientTest.class.
45 - Run: java ProtocolClientTest -options.
46 - Options include:
47   "-P" : proxy name (e.g. npdev.example.com)
48   "-p" : proxy port (match "accept_port" argument passed to the plugin)
49   "-s" : origin server name
50   "-f" : file list name (generated by file_gen.sh)
51   "-n" : number of pipelined client requests
52   "-l" : how many times of looping
53