libt2n: (tomj) small fix to support data transfers over 2GB
[libt2n] / examples-codegen / example1 / server.cpp
CommitLineData
f6d1a1e3
GE
1#include <signal.h>
2
208db683
JT
3#include <socket_server.hxx>
4#include <command_server.hxx> // for group_command_server
5
6// the automatically generated server side code (cmd_group_t2nexample class)
7#include "t2nexample_server.hxx"
8
c7857475
GE
9int main(int argc, char** argv)
10{
11 // don't kill the server on broken pipe
12 signal(SIGPIPE, SIG_IGN);
208db683 13
c7857475
GE
14 // create local socket server (a.k.a "unix domain socket")
15 // if you want to to create a tcp/ip server you pass the port to the constructor
16 // (for details take a look at the socket_server class documentation)
17 libt2n::socket_server ss("./socket");
18 libt2n::group_command_server<cmd_group_t2nexample> cs(ss);
208db683 19
c7857475
GE
20 // handle requests
21 while(true)
22 cs.handle();
23
24 return 0;
208db683 25}