• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..04-Feb-2021-

client/H03-May-2022-402324

server/H03-May-2022-376299

MakefileH A D04-Feb-2021717 2619

README.mdH A D04-Feb-20212.4 KiB6248

Sample.thriftH A D04-Feb-2021843 4031

ThriftCommon.cppH A D04-Feb-20211.2 KiB3824

ThriftCommon.hH A D04-Feb-20217.6 KiB206127

config.hH A D04-Feb-2021412 2516

thriftme.batH A D04-Feb-202135 21

thriftme.shH A D04-Feb-2021381 2517

transport-sample.slnH A D04-Feb-20211.3 KiB2726

README.md

1Thrift transport sample project
2-------------------------------
3
4This cross-platform project has been built with Windows Visual Studio 10 and
5OSX 10.7.1's g++.  The client and server support socket and pipe transports
6through command-line switches.
7
8Windows supports both named & anonymous pipes; *NIX gets only named
9'pipes' at this time.
10
11Windows-only at this time:
12The client & server are double-ended. Both sides run a server and client to
13enable full duplex bidirectional event signaling. They are simple command
14line apps. The server runs until it's aborted (Ctl-C). The client connects to
15the server, informs the server of its listening pipe/port, runs some more RPCs
16and exits. The server also makes RPC calls to the client to demonstrate
17bidirectional operation.
18
19Prequisites:
20Boost -- tested with Boost 1.47, other versions may work.
21libthrift library -- build the library under "thrift/lib/cpp/"
22thrift IDL compiler -- download from http://thrift.apache.org/download/
23   or build from "thrift/compiler/cpp".  The IDL compiler version should
24   match the thrift source distribution's version. For instance, thrift-0.9.0
25   has a different directory structure than thrift-0.8.0 and the generated
26   files are not compatible.
27
28Note: Bulding the thrift IDL compiler and library are beyond the scope
29of this article. Please refer to the Thrift documentation in the respective
30directories and online.
31
32
33Microsoft Windows with Visual Studio 10
34----------------------------------------
35Copy the IDL compiler 'thrift.exe' to this project folder or to a location in the path.
36Run thriftme.bat to generate the interface source from the thrift files.
37
38Open transport-sample.sln and...
39Adapt the Boost paths for the client and server projects. Right-click on each project, select
40Properties, then:
41Configuration Properties -> C/C++ -> General -> Additional Include Directories
42Configuration Properties -> Linker -> General -> Additional Include Directories
43
44The stock path assumes that Boost is located at the same level as the thrift repo root.
45
46Run the following in separate command prompts from the Release or Debug
47build folder:
48 server.exe -np test
49 client.exe -np test
50
51
52*NIX flavors
53------------
54Build the thrift cpp library.
55Build the IDL compiler and copy it to this project folder.
56Run thriftme.sh to generate the interface source from the thrift files.
57Run 'make'
58
59Run the following in separate shells:
60 server/server -np /tmp/test
61 client/client -np /tmp/test
62