summaryrefslogtreecommitdiff
path: root/ace/XTI_ATM_Mcast.cpp
diff options
context:
space:
mode:
authorjoeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-02 23:38:04 +0000
committerjoeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-02 23:38:04 +0000
commit3e4b479e4600f95e4ad37d313cb4bfc93d829bb4 (patch)
tree86edb2eb7bea85bb26aa258e676fcbe76791dc03 /ace/XTI_ATM_Mcast.cpp
parentf8fd150adae009332d50e0d788aa1da8a9de1c8f (diff)
downloadATCD-3e4b479e4600f95e4ad37d313cb4bfc93d829bb4.tar.gz
Adding new classes to wrap ATM functionality
Diffstat (limited to 'ace/XTI_ATM_Mcast.cpp')
-rw-r--r--ace/XTI_ATM_Mcast.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/ace/XTI_ATM_Mcast.cpp b/ace/XTI_ATM_Mcast.cpp
new file mode 100644
index 00000000000..eeefdf703a5
--- /dev/null
+++ b/ace/XTI_ATM_Mcast.cpp
@@ -0,0 +1,63 @@
+// XTI_ATM_Mcast.cpp
+// $Id$
+
+#define ACE_BUILD_DLL
+#include "ace/XTI_ATM_Mcast.h"
+
+ACE_RCSID(ace, XTI_ATM_Mcast, "$Id$")
+
+#if defined (ACE_HAS_XTI_ATM)
+
+ACE_ALLOC_HOOK_DEFINE(ACE_XTI_ATM_Mcast)
+
+void
+ACE_XTI_ATM_Mcast::dump (void) const
+{
+ ACE_TRACE ("ACE_XTI_ATM_Mcast::dump");
+}
+
+ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast (void)
+{
+ ACE_TRACE ("ACE_XTI_ATM_Mcast::ACE_XTI_ATM_Mcast");
+}
+
+// Add a leaf to the current connection (i.e., multicast).
+
+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)
+{
+ ACE_TRACE ("ACE_XTI_ATM_Mcast::add_leaf");
+
+ struct netbuf call_req;
+ memset(&call_req, 0, sizeof(call_req));
+ call_req.len = remote_sap.get_size ();
+ call_req.buf = (char *)remote_sap.get_addr ();
+
+ if (::t_addleaf(current_stream.get_handle(),
+ leaf_id,
+ &call_req) < 0)
+ {
+ // Check for asynchronous event
+ if (t_errno == TLOOK)
+ {
+ int event;
+ event = ACE_OS::t_look(current_stream.get_handle());
+ if (event != TNODATA && event != T_DATA)
+ return -1;
+ else
+ // If this doesn't work for asynchronous calls we need to call
+ // the XTI/ATM t_rcvleafchange() function to check for t_addleaf
+ // completion.
+ return complete (current_stream, 0, timeout);
+ }
+ else
+ return -1;
+ }
+
+ return 0;
+}
+
+#endif /* ACE_HAS_XTI_ATM */