X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=examples%2Fminimalistic-server.cpp;fp=examples%2Fminimalistic-server.cpp;h=46cb9ec27732d9847cee354cf6ddd6cbc8293a31;hp=0000000000000000000000000000000000000000;hb=db49c2f908cd5a007e21d27ba614eb4018f92efc;hpb=27cd718283ad61092e8bf1d874d8ce62e0131048 diff --git a/examples/minimalistic-server.cpp b/examples/minimalistic-server.cpp new file mode 100644 index 0000000..46cb9ec --- /dev/null +++ b/examples/minimalistic-server.cpp @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2004 by Intra2net AG * + * info@intra2net.com * + * * + ***************************************************************************/ + +#include +#include + +#include "minimalistic-stub.hxx" + +#include +#include + +using namespace std; + +LIBT2P_EXPORT string testfunc(const string& str) +{ + string ret; + if (str=="throw") + throw libt2n::t2n_runtime_error("throw me around"); + if (str=="big") + ret.insert(0,100*1024,'x'); + else + ret=str+", testfunc() was here"; + return ret; +} + +using namespace libt2n; + +int main(int argc, char** argv) { + extended_type_info_test(); + + socket_server ss("./socket"); + group_command_server cs(ss); + + // handle requests (without timeout) + while(true) + cs.handle(); + + return 0; +}