Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

XTI_ATM_Mcast.cpp

Go to the documentation of this file.
00001 #include "ace_pch.h"
00002 // XTI_ATM_Mcast.cpp
00003 // $Id: XTI_ATM_Mcast.cpp,v 1.1.1.3.64.1 2003/03/13 19:44:24 chad Exp $
00004 
00005 #include "ace/XTI_ATM_Mcast.h"
00006 
00007 ACE_RCSID(ace, XTI_ATM_Mcast, "$Id: XTI_ATM_Mcast.cpp,v 1.1.1.3.64.1 2003/03/13 19:44:24 chad Exp $")
00008 
00009 #if defined (ACE_HAS_XTI_ATM)
00010 
00011 #if !defined (__ACE_INLINE__)
00012 #include "ace/XTI_ATM_Mcast.i"
00013 #endif /* __ACE_INLINE__ */
00014 
00015 ACE_ALLOC_HOOK_DEFINE(ACE_XTI_ATM_Mcast)
00016 
00017 void
00018 ACE_XTI_ATM_Mcast::dump (void) const
00019 {
00020   ACE_TRACE ("ACE_XTI_ATM_Mcast::dump");
00021 }
00022 
00023 ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast (void)
00024 {
00025   ACE_TRACE ("ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast");
00026 }
00027 
00028 // Add a leaf to the current connection (i.e., multicast).
00029 
00030 int
00031 ACE_XTI_ATM_Mcast::add_leaf (ACE_TLI_Stream &current_stream, 
00032                              const ACE_Addr &remote_sap,
00033                              ACE_INT32 leaf_id,
00034                              ACE_Time_Value *timeout)
00035 {
00036   ACE_TRACE ("ACE_XTI_ATM_Mcast::add_leaf");
00037 
00038   struct netbuf call_req;
00039   memset(&call_req, 0, sizeof(call_req));
00040   call_req.len = remote_sap.get_size ();
00041   call_req.buf = (char *)remote_sap.get_addr ();
00042 
00043   if (::t_addleaf(current_stream.get_handle(),
00044                   leaf_id,
00045                   &call_req) < 0)
00046     {
00047       // Check for asynchronous event
00048       if (t_errno == TLOOK)
00049         {
00050           int event;
00051           event = ACE_OS::t_look(current_stream.get_handle());
00052           if (event != TNODATA && event != T_DATA)
00053             return -1;
00054           else
00055             // If this doesn't work for asynchronous calls we need to call
00056             // the XTI/ATM t_rcvleafchange() function to check for t_addleaf
00057             // completion.
00058             return complete (current_stream, 0, timeout);
00059         }
00060       else
00061         return -1;
00062     }
00063 
00064   return 0;
00065 }
00066 
00067 #endif /* ACE_HAS_XTI_ATM */

Generated on Mon Jun 16 11:22:12 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002