00001
00002
00003
00004
00005
00006 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00007
00008 ACE_INLINE void
00009 ACE_ATM_Connector::dump (void) const
00010 {
00011 #if defined (ACE_HAS_DUMP)
00012 ACE_TRACE ("ACE_ATM_Connector::dump");
00013 #endif
00014 }
00015
00016 ACE_INLINE
00017 ACE_ATM_Connector::ACE_ATM_Connector (ACE_ATM_Stream &new_stream,
00018 const ACE_ATM_Addr &remote_sap,
00019 ACE_ATM_Params params,
00020 ACE_ATM_QoS options,
00021 ACE_Time_Value *timeout,
00022 const ACE_ATM_Addr &local_sap,
00023 int reuse_addr,
00024 int flags,
00025 int perms)
00026 {
00027 ACE_TRACE ("ACE_ATM_Connector::ACE_ATM_Connector");
00028 if ((ACE_HANDLE)this->connect (new_stream,
00029 remote_sap,
00030 params,
00031 options,
00032 timeout,
00033 local_sap,
00034 reuse_addr,
00035 flags,
00036 perms) == ACE_INVALID_HANDLE
00037 && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME))
00038 ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"),
00039 ACE_LIB_TEXT ("ACE_ATM_Stream::ACE_ATM_Stream")));
00040 }
00041
00042
00043
00044 ACE_INLINE
00045 int
00046 ACE_ATM_Connector::complete (ACE_ATM_Stream &new_stream,
00047 ACE_ATM_Addr *remote_sap,
00048 ACE_Time_Value *tv)
00049 {
00050 ACE_TRACE ("ACE_ATM_Connector::complete");
00051 #if defined (ACE_HAS_ATM)
00052 return connector_.complete(new_stream.get_stream(),
00053 remote_sap,
00054 tv);
00055 #else
00056 ACE_UNUSED_ARG(new_stream);
00057 ACE_UNUSED_ARG(remote_sap);
00058 ACE_UNUSED_ARG(tv);
00059 return 0;
00060 #endif
00061 }
00062
00063 ACE_INLINE
00064 int
00065 ACE_ATM_Connector::add_leaf (ACE_ATM_Stream ¤t_stream,
00066 const ACE_Addr &remote_sap,
00067 ACE_ATM_QoS &qos)
00068 {
00069 ACE_TRACE ("ACE_ATM_Connector::add_leaf");
00070 #if defined (ACE_HAS_FORE_ATM_XTI)
00071 return connector_.add_leaf(current_stream.get_stream(),
00072 remote_sap,
00073 leaf_id,
00074 timeout);
00075 #elif defined (ACE_HAS_FORE_ATM_WS2)
00076 struct sockaddr_atm *saddr = (struct sockaddr_atm *)remote_sap.get_addr();
00077 ACE_QoS cqos = qos.get_qos();
00078 int addr_len = sizeof( struct sockaddr_atm );
00079
00080 ACE_QoS_Params qos_params(0,
00081 0,
00082 &cqos,
00083 0,
00084 (JL_SENDER_ONLY));
00085
00086 ACE_OS::printf( "ATM_Connector::add_leaf: connecting...\n" );
00087
00088 ACE_HANDLE result = ACE_OS::join_leaf(current_stream.get_handle(),
00089 (struct sockaddr *)saddr,
00090 addr_len,
00091 qos_params);
00092
00093 if ( result == ACE_INVALID_HANDLE )
00094 ACE_OS::printf( "ATM_Connector(add_leaf): connection failed, %d\n",
00095 ::WSAGetLastError());
00096
00097 return (result != ACE_INVALID_HANDLE);
00098 #elif defined (ACE_HAS_LINUX_ATM)
00099 ACE_OS::printf("ATM_Connector(add_leaf): not yet implemented in Linux \n");
00100
00101 ACE_UNUSED_ARG(current_stream);
00102 ACE_UNUSED_ARG(remote_sap);
00103 ACE_UNUSED_ARG(leaf_id);
00104 ACE_UNUSED_ARG(timeout);
00105
00106 return 0;
00107 #else
00108 ACE_UNUSED_ARG(current_stream);
00109 ACE_UNUSED_ARG(remote_sap);
00110 ACE_UNUSED_ARG(leaf_id);
00111 ACE_UNUSED_ARG(timeout);
00112 return 0;
00113 #endif
00114 }
00115
00116 ACE_INLINE
00117 int
00118 ACE_ATM_Connector::reset_new_handle (ACE_HANDLE handle)
00119 {
00120 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00121
00122 return ::WSAEventSelect ((SOCKET) handle,
00123 0,
00124 0);
00125 #else
00126 ACE_UNUSED_ARG (handle);
00127 return 0;
00128 #endif
00129 }
00130
00131
00132 ACE_END_VERSIONED_NAMESPACE_DECL