/[resiprocate]/main/resip/dum/test/limpc.cxx
ViewVC logotype

Diff of /main/resip/dum/test/limpc.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5948 by dworley, Fri Feb 17 15:30:16 2006 UTC revision 7265 by bcampen, Tue Sep 25 21:44:52 2007 UTC
# Line 16  Line 16 
16  #include "resip/stack/Uri.hxx"  #include "resip/stack/Uri.hxx"
17  #include "rutil/Logger.hxx"  #include "rutil/Logger.hxx"
18    
19    #include <signal.h>
20    
21  using namespace resip;  using namespace resip;
22  using namespace std;  using namespace std;
23    
24  #define RESIPROCATE_SUBSYSTEM Subsystem::SIP  #define RESIPROCATE_SUBSYSTEM Subsystem::SIP
25    
26    static bool finished = false;
27    
28    static void
29    signalHandler(int signo)
30    {
31       std::cerr << "Shutting down" << endl;
32       finished = true;
33    }
34    
35  int  int
36  main(int argc, char* argv[])  main(int argc, char* argv[])
37  {  {
38    #ifndef _WIN32
39       if ( signal( SIGPIPE, SIG_IGN) == SIG_ERR)
40       {
41          cerr << "Couldn't install signal handler for SIGPIPE" << endl;
42          exit(-1);
43       }
44    #endif
45    
46       if ( signal( SIGINT, signalHandler ) == SIG_ERR )
47       {
48          cerr << "Couldn't install signal handler for SIGINT" << endl;
49          exit( -1 );
50       }
51    
52       if ( signal( SIGTERM, signalHandler ) == SIG_ERR )
53       {
54          cerr << "Couldn't install signal handler for SIGTERM" << endl;
55          exit( -1 );
56       }
57    
58     try     try
59     {     {
60        UserAgent ua(argc, argv);        UserAgent ua(argc, argv);
61        ua.startup();        ua.startup();
62                
63        InfoLog(<< argv[0] << " starting");        InfoLog(<< argv[0] << " starting");
64        while(1)        while(!finished)
65        {        {
66           ua.process();           ua.process();
67        }        }

Legend:
Removed from v.5948  
changed lines
  Added in v.7265

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27