27 ACE_INET_Addr ace_address(yarp_address.
getPort(), yarp_address.
getHost().c_str());
30 return connect(ace_address);
32 ACE_INET_Addr ace_server_addr(ace_address.get_port_number());
34 int result = m_Acceptor.open(ace_server_addr);
41 m_Acceptor.get_local_addr(ace_server_addr);
43 m_LocalAddress =
yarp::os::Contact(ace_server_addr.get_host_addr(), ace_server_addr.get_port_number());
44 m_RemoteAddress = m_LocalAddress;
66 ACE_INET_Addr local, remote;
67 m_SockStream.get_local_addr(local);
68 m_SockStream.get_remote_addr(remote);
69 m_LocalAddress =
yarp::os::Contact(local.get_host_addr(), local.get_port_number());
70 m_RemoteAddress =
yarp::os::Contact(remote.get_host_addr(), remote.get_port_number());
73 result = m_SockStream.recv_n(&recv_conn_data,
sizeof recv_conn_data);
80 if (!in.
open(m_RemoteAddress.
getPort(), &m_SockStream)) {
93 send_conn_data.
command = ACKNOWLEDGE;
94 if (m_SockStream.send_n(&send_conn_data,
sizeof send_conn_data) <= 0) {
102 m_SockStream.enable(ACE_NONBLOCK);
107 int ShmemHybridStream::connect(
const ACE_INET_Addr& ace_address)
113 ACE_SOCK_Connector connector;
121 ACE_INET_Addr local, remote;
122 m_SockStream.get_local_addr(local);
123 m_SockStream.get_remote_addr(remote);
124 m_LocalAddress =
yarp::os::Contact(local.get_host_addr(), local.get_port_number());
125 m_RemoteAddress =
yarp::os::Contact(remote.get_host_addr(), remote.get_port_number());
130 send_conn_data.
command = CONNECT;
132 result = m_SockStream.send_n(&send_conn_data,
sizeof send_conn_data);
140 result = m_SockStream.recv_n(&recv_conn_data,
sizeof recv_conn_data);
151 m_SockStream.enable(ACE_NONBLOCK);
197 return m_bLinked && in.
isOk() && out.
isOk();
216 return m_LocalAddress;
221 return m_RemoteAddress;