XTI_ATM_Mcast.cpp

Go to the documentation of this file.
00001 // XTI_ATM_Mcast.cpp,v 4.7 2006/04/19 11:54:56 jwillemsen Exp
00002 
00003 #include "ace/XTI_ATM_Mcast.h"
00004 
00005 ACE_RCSID(ace, XTI_ATM_Mcast, "XTI_ATM_Mcast.cpp,v 4.7 2006/04/19 11:54:56 jwillemsen Exp")
00006 
00007 #if defined (ACE_HAS_XTI_ATM)
00008 
00009 #if !defined (__ACE_INLINE__)
00010 #include "ace/XTI_ATM_Mcast.inl"
00011 #endif /* __ACE_INLINE__ */
00012 
00013 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00014 
00015 ACE_ALLOC_HOOK_DEFINE(ACE_XTI_ATM_Mcast)
00016 
00017 void
00018 ACE_XTI_ATM_Mcast::dump (void) const
00019 {
00020 #if defined (ACE_HAS_DUMP)
00021   ACE_TRACE ("ACE_XTI_ATM_Mcast::dump");
00022 #endif /* ACE_HAS_DUMP */
00023 }
00024 
00025 ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast (void)
00026 {
00027   ACE_TRACE ("ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast");
00028 }
00029 
00030 // Add a leaf to the current connection (i.e., multicast).
00031 
00032 int
00033 ACE_XTI_ATM_Mcast::add_leaf (ACE_TLI_Stream &current_stream,
00034                              const ACE_Addr &remote_sap,
00035                              ACE_INT32 leaf_id,
00036                              ACE_Time_Value *timeout)
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 }
00067 
00068 ACE_END_VERSIONED_NAMESPACE_DECL
00069 
00070 #endif /* ACE_HAS_XTI_ATM */

Generated on Thu Nov 9 09:42:10 2006 for ACE by doxygen 1.3.6