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

..--

client/11-Mar-2024-443353

server/11-Mar-2024-417328

MakefileD11-Mar-2024717 2619

README.mdD11-Mar-20242.4 KiB6248

Sample.thriftD11-Mar-20241.6 KiB5949

ThriftCommon.cppD11-Mar-20241.2 KiB3824

ThriftCommon.hD11-Mar-20247.6 KiB206127

config.hD11-Mar-2024412 2516

thriftme.batD11-Mar-202435 21

thriftme.shD11-Mar-2024381 2517

transport-sample.slnD11-Mar-20241.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