Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / apps / JAWS3 / small / SS_Service_Handler.cpp
blobae3a2b7d395b32ae19ab3e674127d5371506dd92
1 #define ACE_BUILD_SVC_DLL
3 #include "ace/Get_Opt.h"
5 #include "jaws3/Concurrency.h"
7 #include "SS_Service_Handler.h"
8 #include "SS_State_READ.h"
9 #include "SS_Data.h"
11 TeraSS_Service_Handler::TeraSS_Service_Handler ()
12 : JAWS_Protocol_Handler (TeraSS_State_READ::instance (), & this->data_)
13 , data_ (this)
17 int
18 TeraSS_Service_Handler::open (void *)
20 int result = JAWS_Concurrency::instance ()->putq (this);
21 if (result < 0)
22 return -1;
24 return 0;
27 int
28 TeraSS_Service_Handler::close (unsigned long)
30 delete this;
31 return 0;
34 int
35 TeraSS_Acceptor::init (int argc, ACE_TCHAR *argv[])
37 ACE_Get_Opt opt (argc, argv, ACE_TEXT("p:"));
39 unsigned short p = 0;
41 int c;
42 while ((c = opt ()) != -1)
43 switch (c)
45 case 'p':
46 p = (unsigned short) ACE_OS::atoi (opt.optarg);
47 break;
48 default:
49 break;
52 if (p == 0)
53 p = 5555;
55 if (this->open (ACE_INET_Addr (p)) == -1)
57 ACE_DEBUG ((LM_DEBUG, "%p\n", "ACE_Acceptor::open"));
58 return -1;
61 return 0;
64 ACE_SVC_FACTORY_DEFINE (TeraSS_Acceptor)