From 29ba0e9777f576fa318decb2915bf8895bf233eb Mon Sep 17 00:00:00 2001 From: Jens Thiele Date: Tue, 21 Nov 2006 11:00:02 +0000 Subject: [PATCH] test multiple groups --- example-codegen/client.cpp | 4 +++- example-codegen/server.cpp | 10 +++++++--- example-codegen/server.hxx | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/example-codegen/client.cpp b/example-codegen/client.cpp index f7d94ea..97d309e 100644 --- a/example-codegen/client.cpp +++ b/example-codegen/client.cpp @@ -12,7 +12,9 @@ int main(int argc, char** argv) { libt2n::socket_client_connection sc("./socket"); + libt2n::socket_client_connection sc_other("./socket_other"); cmd_group_default_client cc(sc); + cmd_group_other_client cc_other(sc_other); bool throwok=false; try @@ -26,6 +28,6 @@ int main(int argc, char** argv) && ( cc.testfunc("hello") == "hello, testfunc() was here" ) && ( cc.testfunc_ref("hello") == "hello, testfunc() was here" ) && ( cc.t2(10) == 10 ) - && ( cc.t3(10, 20, "hello", std::pair(10,20)) ) ) + && ( cc_other.t3(10, 20, "hello", std::pair(10,20)) ) ) ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/example-codegen/server.cpp b/example-codegen/server.cpp index aa8af26..7bf0bf2 100644 --- a/example-codegen/server.cpp +++ b/example-codegen/server.cpp @@ -7,11 +7,15 @@ using namespace libt2n; int main(int argc, char** argv) { socket_server ss("./socket"); + socket_server ss_other("./socket_other"); group_command_server cs(ss); + group_command_server cs_other(ss_other); - // handle requests (without timeout) - while(true) - cs.handle(); + // handle requests + while(true) { + cs.handle(1000); + cs_other.handle(1000); + } return 0; } diff --git a/example-codegen/server.hxx b/example-codegen/server.hxx index b20708b..ccca538 100644 --- a/example-codegen/server.hxx +++ b/example-codegen/server.hxx @@ -34,7 +34,7 @@ LIBT2N_EXPORT int t2(int i) using namespace std; -LIBT2N_EXPORT bool t3(int i, float f, const string &s, const pair &p) +LIBT2N_EXPORT_GROUP(other) bool t3(int i, float f, const string &s, const pair &p) { return (i==p.first) && (f==p.second) && (s=="hello"); } -- 1.7.1