Dear Wiki user, You have subscribed to a wiki page or wiki category on "Thrift Wiki" for change notification.
The following page has been changed by HannesBaldursson: http://wiki.apache.org/thrift/ThriftUsageC++ ------------------------------------------------------------------------------ * your-thrift-file_types.cpp * your-thrift-file_types.h - === Writing the Server === + === Implementing the Server === Copy the generated server skeleton to a file named Something_server.cpp and keep the original: {{{ @@ -52, +52 @@ }}} - Here's the autogenerated skeleton file to illustrate how to write a server: + Here's the autogenerated skeleton file to illustrate how to write a server: '''Something_server.cpp''' - '''Something_server.cpp''' + + When this server is run in console it prints "ping" on the console window each time the function is called from a client. {{{ #include "Something.h" #include <protocol/TBinaryProtocol.h> @@ -73, +74 @@ class SomethingHandler : virtual public SomethingIf { public: SomethingHandler() { - // Your initialization goes here + ''' // Your initialization goes here''' } int32_t ping() { - // Your implementation goes here + ''''// Your implementation goes here''' printf("ping\n"); } @@ -97, +98 @@ } }}} + The rest is literally as easy as filling in the blanks. +
