X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=examples-codegen%2Fexample1%2Fserver.cpp;h=e6361737cab280da02dddf58cb4ed20c9eb6d0bb;hp=f392e03df6b5b7d3f17cce1b49105d2de5d43622;hb=HEAD;hpb=208db683069afb57aeb0ef0e6897c014b870bb6f diff --git a/examples-codegen/example1/server.cpp b/examples-codegen/example1/server.cpp index f392e03..e636173 100644 --- a/examples-codegen/example1/server.cpp +++ b/examples-codegen/example1/server.cpp @@ -1,18 +1,25 @@ +#include + #include #include // for group_command_server // the automatically generated server side code (cmd_group_t2nexample class) #include "t2nexample_server.hxx" -int main(int argc, char** argv) { - // create local socket server (a.k.a "unix domain socket") - // if you want to to create a tcp/ip server you pass the port to the constructor (for details take a look at the socket_server class documentation) - libt2n::socket_server ss("./socket"); - libt2n::group_command_server cs(ss); +int main(int argc, char** argv) +{ + // don't kill the server on broken pipe + signal(SIGPIPE, SIG_IGN); + + // create local socket server (a.k.a "unix domain socket") + // if you want to to create a tcp/ip server you pass the port to the constructor + // (for details take a look at the socket_server class documentation) + libt2n::socket_server ss("./socket"); + libt2n::group_command_server cs(ss); - // handle requests - while(true) - cs.handle(); + // handle requests + while(true) + cs.handle(); - return 0; + return 0; }