ACE_XTI_ATM_Mcast Class Reference

Defines an active connection factory for the ACE_TLI C++ wrappers to support XTI/ATM multicast. More...

#include <XTI_ATM_Mcast.h>

Inheritance diagram for ACE_XTI_ATM_Mcast:

Inheritance graph
[legend]
Collaboration diagram for ACE_XTI_ATM_Mcast:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_ATM_Addr PEER_ADDR
typedef ACE_TLI_Stream PEER_STREAM

Public Member Functions

 ACE_XTI_ATM_Mcast (void)
 Default constructor.

 ACE_XTI_ATM_Mcast (ACE_TLI_Stream &new_stream, const ACE_Addr &remote_sap, ACE_Time_Value *timeout=0, const ACE_Addr &local_sap=ACE_Addr::sap_any, int reuse_addr=0, int flags=O_RDWR, int perms=0, const char device[]=ACE_XTI_ATM_DEVICE, struct t_info *info=0, int rw_flag=1, struct netbuf *udata=0, struct netbuf *opt=0)
int connect (ACE_TLI_Stream &new_stream, const ACE_Addr &remote_sap, ACE_Time_Value *timeout=0, const ACE_Addr &local_sap=ACE_Addr::sap_any, int reuse_addr=0, int flags=O_RDWR, int perms=0, const char device[]=ACE_XTI_ATM_DEVICE, struct t_info *info=0, int rw_flag=1, struct netbuf *udata=0, struct netbuf *opt=0)
int add_leaf (ACE_TLI_Stream &current_stream, const ACE_Addr &remote_sap, ACE_INT32 leaf_id, ACE_Time_Value *timeout=0)
void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Detailed Description

Defines an active connection factory for the ACE_TLI C++ wrappers to support XTI/ATM multicast.

Definition at line 37 of file XTI_ATM_Mcast.h.


Member Typedef Documentation

typedef ACE_ATM_Addr ACE_XTI_ATM_Mcast::PEER_ADDR
 

Reimplemented from ACE_TLI_Connector.

Definition at line 117 of file XTI_ATM_Mcast.h.

typedef ACE_TLI_Stream ACE_XTI_ATM_Mcast::PEER_STREAM
 

Reimplemented from ACE_TLI_Connector.

Definition at line 118 of file XTI_ATM_Mcast.h.


Constructor & Destructor Documentation

ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast void   ) 
 

Default constructor.

Definition at line 25 of file XTI_ATM_Mcast.cpp.

References ACE_TRACE.

00026 {
00027   ACE_TRACE ("ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast");
00028 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast ACE_TLI_Stream new_stream,
const ACE_Addr remote_sap,
ACE_Time_Value timeout = 0,
const ACE_Addr local_sap = ACE_Addr::sap_any,
int  reuse_addr = 0,
int  flags = O_RDWR,
int  perms = 0,
const char  device[] = ACE_XTI_ATM_DEVICE,
struct t_info *  info = 0,
int  rw_flag = 1,
struct netbuf *  udata = 0,
struct netbuf *  opt = 0
 

Actively connect and produce a if things go well. The is the address that we are trying to connect with. The is the amount of time to wait to connect. If it's 0 then we block indefinitely. If *timeout == {0, 0} then the connection is done using non-blocking mode. In this case, if the connection can't be made immediately the value of -1 is returned with <errno == EWOULDBLOCK>. If *timeout > {0, 0} then this is the amount of time to wait before timing out. If the time expires before the connection is made <errno == ETIME>. The is the value of local address to bind to. If it's the default value of <ACE_Addr::sap_any> then the user is letting the OS do the binding. If == 1 then the is reused, even if it hasn't been cleanedup yet.

Definition at line 8 of file XTI_ATM_Mcast.inl.

References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, connect(), ETIME, EWOULDBLOCK, and LM_ERROR.

00020 {
00021   ACE_TRACE ("ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast");
00022   if (this->connect (new_stream, remote_sap, timeout, local_sap, reuse_addr,
00023            flags, perms, device,
00024            info, rw_flag,
00025            udata, opt) == ACE_INVALID_HANDLE
00026       && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME))
00027     ACE_ERROR ((LM_ERROR,  ACE_LIB_TEXT ("%p\n"),  ACE_LIB_TEXT ("ACE_TLI_Stream::ACE_TLI_Stream")));
00028 }


Member Function Documentation

int ACE_XTI_ATM_Mcast::add_leaf ACE_TLI_Stream current_stream,
const ACE_Addr remote_sap,
ACE_INT32  leaf_id,
ACE_Time_Value timeout = 0
 

Actively add a leaf to the currently connected stream (i.e., multicast). The is the address of the leaf that we are trying to add. The is the amount of time to wait to connect. If it's 0 then we block indefinitely. If *timeout == {0, 0} then the connection is done using non-blocking mode. In this case, if the connection can't be made immediately the value of -1 is returned with <errno == EWOULDBLOCK>. If *timeout > {0, 0} then this is the amount of time to wait before timing out. If the time expires before the connection is made <errno == ETIME>.

Definition at line 33 of file XTI_ATM_Mcast.cpp.

References ACE_TRACE, ACE_TLI_Connector::complete(), ACE_Addr::get_addr(), ACE_IPC_SAP::get_handle(), ACE_Addr::get_size(), and ACE_OS::t_look().

00037 {
00038   ACE_TRACE ("ACE_XTI_ATM_Mcast::add_leaf");
00039 
00040   struct netbuf call_req;
00041   memset(&call_req, 0, sizeof(call_req));
00042   call_req.len = remote_sap.get_size ();
00043   call_req.buf = (char *)remote_sap.get_addr ();
00044 
00045   if (::t_addleaf(current_stream.get_handle(),
00046                   leaf_id,
00047                   &call_req) < 0)
00048     {
00049       // Check for asynchronous event
00050       if (t_errno == TLOOK)
00051         {
00052           int const event = ACE_OS::t_look(current_stream.get_handle());
00053           if (event != TNODATA && event != T_DATA)
00054             return -1;
00055           else
00056             // If this doesn't work for asynchronous calls we need to call
00057             // the XTI/ATM t_rcvleafchange() function to check for t_addleaf
00058             // completion.
00059             return complete (current_stream, 0, timeout);
00060         }
00061       else
00062         return -1;
00063     }
00064 
00065   return 0;
00066 }

ACE_INLINE int ACE_XTI_ATM_Mcast::connect ACE_TLI_Stream new_stream,
const ACE_Addr remote_sap,
ACE_Time_Value timeout = 0,
const ACE_Addr local_sap = ACE_Addr::sap_any,
int  reuse_addr = 0,
int  flags = O_RDWR,
int  perms = 0,
const char  device[] = ACE_XTI_ATM_DEVICE,
struct t_info *  info = 0,
int  rw_flag = 1,
struct netbuf *  udata = 0,
struct netbuf *  opt = 0
 

Actively connect and produce a if things go well. The is the address that we are trying to connect with. The is the amount of time to wait to connect. If it's 0 then we block indefinitely. If *timeout == {0, 0} then the connection is done using non-blocking mode. In this case, if the connection can't be made immediately the value of -1 is returned with <errno == EWOULDBLOCK>. If *timeout > {0, 0} then this is the amount of time to wait before timing out. If the time expires before the connection is made <errno == ETIME>. The is the value of local address to bind to. If it's the default value of <ACE_Addr::sap_any> then the user is letting the OS do the binding. If == 1 then the is reused, even if it hasn't been cleanedup yet.

Reimplemented from ACE_TLI_Connector.

Definition at line 37 of file XTI_ATM_Mcast.inl.

References ACE_TRACE, and ACE_TLI_Connector::connect().

Referenced by ACE_XTI_ATM_Mcast().

00049 {
00050   ACE_TRACE ("ACE_XTI_ATM_Mcast::connect");
00051   return ACE_TLI_Connector::connect(new_stream,
00052                                     remote_sap,
00053                                     timeout,
00054                                     local_sap,
00055                                     reuse_addr,
00056                                     flags,
00057                                     perms,
00058                                     device,
00059                                     info,
00060                                     rw_flag,
00061                                     udata,
00062                                     opt);
00063 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL void ACE_XTI_ATM_Mcast::dump void   )  const
 

Dump the state of an object.

Reimplemented from ACE_TLI_Connector.

Definition at line 18 of file XTI_ATM_Mcast.cpp.

References ACE_TRACE.

00019 {
00020 #if defined (ACE_HAS_DUMP)
00021   ACE_TRACE ("ACE_XTI_ATM_Mcast::dump");
00022 #endif /* ACE_HAS_DUMP */
00023 }


Member Data Documentation

ACE_XTI_ATM_Mcast::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_TLI_Connector.

Definition at line 124 of file XTI_ATM_Mcast.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:33:31 2006 for ACE by doxygen 1.3.6