Use override/default for RTPortableServer
[ACE_TAO.git] / ACE / ace / ATM_Connector.inl
blob4493be6afa843ea42d2600e5b4f9dc38f8cf73ff
1 // -*- C++ -*-
2 // Open versioned namespace, if enabled by the user.
3 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
5 ACE_INLINE void
6 ACE_ATM_Connector::dump () const
8 #if defined (ACE_HAS_DUMP)
9   ACE_TRACE ("ACE_ATM_Connector::dump");
10 #endif /* ACE_HAS_DUMP */
13 ACE_INLINE
14 ACE_ATM_Connector::ACE_ATM_Connector (ACE_ATM_Stream &new_stream,
15                                       const ACE_ATM_Addr &remote_sap,
16                                       ACE_ATM_Params params,
17                                       ACE_ATM_QoS options,
18                                       ACE_Time_Value *timeout,
19                                       const ACE_ATM_Addr &local_sap,
20                                       int reuse_addr,
21                                       int flags,
22                                       int perms)
24   ACE_TRACE ("ACE_ATM_Connector::ACE_ATM_Connector");
25   if ((ACE_HANDLE)this->connect (new_stream,
26                                  remote_sap,
27                                  params,
28                                  options,
29                                  timeout,
30                                  local_sap,
31                                  reuse_addr,
32                                  flags,
33                                  perms) == ACE_INVALID_HANDLE
34       && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME))
35     ACELIB_ERROR ((LM_ERROR,  ACE_TEXT ("%p\n"),
36                 ACE_TEXT ("ACE_ATM_Stream::ACE_ATM_Stream")));
39 // Try to complete a non-blocking connection.
41 ACE_INLINE
42 int
43 ACE_ATM_Connector::complete (ACE_ATM_Stream &new_stream,
44                              ACE_ATM_Addr *remote_sap,
45                              ACE_Time_Value *tv)
47   ACE_TRACE ("ACE_ATM_Connector::complete");
48 #if defined (ACE_HAS_ATM)
49   return connector_.complete(new_stream.get_stream(),
50                              remote_sap,
51                              tv);
52 #else
53   ACE_UNUSED_ARG(new_stream);
54   ACE_UNUSED_ARG(remote_sap);
55   ACE_UNUSED_ARG(tv);
56   return 0;
57 #endif
60 ACE_INLINE
61 int
62 ACE_ATM_Connector::add_leaf (ACE_ATM_Stream &current_stream,
63                              const ACE_Addr &remote_sap,
64                              ACE_ATM_QoS &qos)
66   ACE_TRACE ("ACE_ATM_Connector::add_leaf");
67 #if defined (ACE_HAS_FORE_ATM_XTI)
68   return connector_.add_leaf(current_stream.get_stream(),
69                              remote_sap,
70                              leaf_id,
71                              timeout);
72 #elif defined (ACE_HAS_FORE_ATM_WS2)
73   struct sockaddr_atm *saddr = (struct sockaddr_atm *)remote_sap.get_addr();
74   ACE_QoS cqos = qos.get_qos();
75   int addr_len = sizeof( struct sockaddr_atm);
77   ACE_QoS_Params qos_params(0,
78                             0,
79                             &cqos,
80                             0,
81                             (JL_SENDER_ONLY));
83   ACE_OS::printf( "ATM_Connector::add_leaf: connecting...\n");
85   ACE_HANDLE result = ACE_OS::join_leaf(current_stream.get_handle(),
86                                         (struct sockaddr *)saddr,
87                                         addr_len,
88                                         qos_params);
90   if ( result == ACE_INVALID_HANDLE )
91     ACE_OS::printf( "ATM_Connector(add_leaf): connection failed, %d\n",
92                     ::WSAGetLastError());
94   return (result != ACE_INVALID_HANDLE);
95 #elif defined (ACE_HAS_LINUX_ATM)
96   ACE_OS::printf("ATM_Connector(add_leaf): not yet implemented in Linux\n");
98   ACE_UNUSED_ARG(current_stream);
99   ACE_UNUSED_ARG(remote_sap);
100   ACE_UNUSED_ARG(leaf_id);
101   ACE_UNUSED_ARG(timeout);
103   return 0;
104 #else
105   ACE_UNUSED_ARG(current_stream);
106   ACE_UNUSED_ARG(remote_sap);
107   ACE_UNUSED_ARG(leaf_id);
108   ACE_UNUSED_ARG(timeout);
109   return 0;
110 #endif
113 ACE_INLINE
114 bool
115 ACE_ATM_Connector::reset_new_handle (ACE_HANDLE handle)
117 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
118   // Reset the event association
119   return ::WSAEventSelect ((SOCKET) handle,
120                            0,
121                            0);
122 #else /* !defined ACE_HAS_WINSOCK2 */
123   ACE_UNUSED_ARG (handle);
124   return false;
125 #endif /* ACE_WIN32 */
128 // Close versioned namespace, if enabled by the user.
129 ACE_END_VERSIONED_NAMESPACE_DECL