~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to examples/Connection/non_blocking/test_lsock_acceptor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// test_lsock_acceptor.cpp,v 4.9 2003/02/28 21:05:10 ossama Exp
2
 
 
3
 
// ACE_LSOCK Server.
4
 
 
5
 
#include "ace/LSOCK_Acceptor.h"
6
 
#include "ace/Log_Msg.h"
7
 
#include "ace/Service_Config.h"
8
 
 
9
 
 
10
 
#if defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS)
11
 
int
12
 
main (int, char *argv[])
13
 
{
14
 
  ACE_ERROR_RETURN ((LM_INFO,
15
 
                     ACE_TEXT ("%s: not supported with ")
16
 
                     ACE_TEXT ("ACE_LACKS_UNIX_DOMAIN_SOCKETS\n"),
17
 
                     argv[0]),
18
 
                     -1);
19
 
}
20
 
 
21
 
#else  /* ! ACE_LACKS_UNIX_DOMAIN_SOCKETS */
22
 
 
23
 
#include "ace/UNIX_Addr.h"
24
 
#include "CPP-acceptor.h"
25
 
 
26
 
ACE_RCSID (non_blocking,
27
 
           test_lsock_acceptor,
28
 
           "test_lsock_acceptor.cpp,v 4.9 2003/02/28 21:05:10 ossama Exp")
29
 
 
30
 
typedef Svc_Handler<ACE_LSOCK_STREAM> SVC_HANDLER;
31
 
typedef IPC_Server<SVC_HANDLER, ACE_LSOCK_ACCEPTOR> IPC_SERVER;
32
 
 
33
 
int
34
 
main (int argc, char *argv[])
35
 
{
36
 
  // Perform Service_Config initializations
37
 
  ACE_Service_Config daemon (argv[0]);
38
 
 
39
 
  IPC_SERVER peer_acceptor;
40
 
 
41
 
  if (peer_acceptor.init (argc, argv) == -1)
42
 
    ACE_ERROR_RETURN ((LM_ERROR,
43
 
                       "%p\n",
44
 
                       "init"),
45
 
                      -1);
46
 
  return peer_acceptor.svc ();
47
 
}
48
 
 
49
 
 
50
 
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
51
 
template class ACE_Concurrency_Strategy<SVC_HANDLER>;
52
 
template class ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_LSOCK_ACCEPTOR>;
53
 
template class ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH>;
54
 
template class IPC_Server<SVC_HANDLER, ACE_LSOCK_ACCEPTOR>;
55
 
template class Svc_Handler<ACE_LSOCK_STREAM>;
56
 
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
57
 
#pragma instantiate ACE_Concurrency_Strategy<SVC_HANDLER>
58
 
#pragma instantiate ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_LSOCK_ACCEPTOR>
59
 
#pragma instantiate ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH>
60
 
#pragma instantiate IPC_Server<SVC_HANDLER, ACE_LSOCK_ACCEPTOR>
61
 
#pragma instantiate Svc_Handler<ACE_LSOCK_STREAM>
62
 
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
63
 
 
64
 
#endif /* ! ACE_LACKS_UNIX_DOMAIN_SOCKETS */