3 //=============================================================================
5 * @file UIOP_Acceptor.h
7 * Unix Domain Socket (UIOP) specific acceptor processing
9 * @author Fred Kuhns <fredk@cs.wustl.edu>
10 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
12 //=============================================================================
15 #ifndef TAO_UIOP_ACCEPTOR_H
16 #define TAO_UIOP_ACCEPTOR_H
18 #include /**/ "ace/pre.h"
19 #include "tao/orbconf.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 # if TAO_HAS_UIOP == 1
26 #include "tao/Strategies/UIOP_Connection_Handler.h"
28 #include "tao/Transport_Acceptor.h"
29 #include "tao/Acceptor_Impl.h"
30 #include "tao/GIOP_Message_Version.h"
32 #include "ace/Acceptor.h"
33 #include "ace/LSOCK_Acceptor.h"
35 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
38 * @class TAO_UIOP_Acceptor
40 * @brief The UIOP-specific bridge class for the concrete acceptor.
42 class TAO_Strategies_Export TAO_UIOP_Acceptor
: public TAO_Acceptor
45 // TAO_UIOP_Acceptor (ACE_UNIX_Addr &addr);
46 // Create Acceptor object using addr.
48 /// Create Acceptor object using addr.
52 virtual ~TAO_UIOP_Acceptor ();
54 typedef TAO_Strategy_Acceptor
<TAO_UIOP_Connection_Handler
, ACE_LSOCK_ACCEPTOR
> TAO_UIOP_BASE_ACCEPTOR
;
55 typedef TAO_Creation_Strategy
<TAO_UIOP_Connection_Handler
> TAO_UIOP_CREATION_STRATEGY
;
56 typedef TAO_Concurrency_Strategy
<TAO_UIOP_Connection_Handler
> TAO_UIOP_CONCURRENCY_STRATEGY
;
57 typedef TAO_Accept_Strategy
<TAO_UIOP_Connection_Handler
, ACE_LSOCK_ACCEPTOR
> TAO_UIOP_ACCEPT_STRATEGY
;
60 * @name The TAO_Acceptor Methods
62 * Please check the documentation in Transport_Acceptor.h for details.
65 virtual int open (TAO_ORB_Core
*orb_core
,
70 const char *options
= 0);
71 virtual int open_default (TAO_ORB_Core
*orb_core
,
75 const char *options
= 0);
77 virtual int create_profile (const TAO::ObjectKey
&object_key
,
78 TAO_MProfile
&mprofile
,
79 CORBA::Short priority
);
81 virtual int is_collocated (const TAO_Endpoint
* endpoint
);
82 virtual CORBA::ULong
endpoint_count ();
84 virtual int object_key (IOP::TaggedProfile
&profile
,
89 /// Implement the common part of the open*() methods
90 int open_i (const char *rendezvous
,
91 ACE_Reactor
*reactor
);
93 /// Set the rendezvous point and verify that it is
94 /// valid (e.g. wasn't truncated because it was too long).
95 void rendezvous_point (ACE_UNIX_Addr
&, const char *rendezvous
);
97 /// Parse protocol specific options.
98 int parse_options (const char *options
);
100 /// Obtains uiop properties that must be used by this acceptor, i.e.,
101 /// initializes <uiop_properties_>.
102 int init_uiop_properties ();
104 /// Create a UIOP profile representing this acceptor.
105 int create_new_profile (const TAO::ObjectKey
&object_key
,
106 TAO_MProfile
&mprofile
,
107 CORBA::Short priority
);
109 /// Add the endpoints on this acceptor to a shared profile.
110 int create_shared_profile (const TAO::ObjectKey
&object_key
,
111 TAO_MProfile
&mprofile
,
112 CORBA::Short priority
);
115 /// The concrete acceptor, as a pointer to its base class.
116 TAO_UIOP_BASE_ACCEPTOR base_acceptor_
;
118 // Acceptor strategies.
119 TAO_UIOP_CREATION_STRATEGY
*creation_strategy_
;
120 TAO_UIOP_CONCURRENCY_STRATEGY
*concurrency_strategy_
;
121 TAO_UIOP_ACCEPT_STRATEGY
*accept_strategy_
;
123 /// The GIOP version for this endpoint
124 TAO_GIOP_Message_Version version_
;
127 TAO_ORB_Core
*orb_core_
;
129 /// Flag that determines whether or not the rendezvous point should
130 /// be unlinked on close. This is really only used when an error
132 bool unlink_on_close_
;
135 TAO_END_VERSIONED_NAMESPACE_DECL
137 # endif /* TAO_HAS_UIOP == 1 */
139 #include /**/ "ace/post.h"
141 #endif /* TAO_UIOP_ACCEPTOR_H */