bool UTPSocket::connectSuccesFull() { Connection::Ptr ptr = conn.toStrongRef(); if (ptr && ptr->connectionState() == CS_CONNECTED) { setRemoteAddress(ptr->remoteAddress()); m_state = CONNECTED; return true; } else return false; }
const net::Address& UTPSocket::getPeerName() const { Connection::Ptr ptr = conn.toStrongRef(); if (remote_addr_override) return addr; else if (ptr) return ptr->remoteAddress(); else { static net::Address null; return null; } }
UTPSocket::UTPSocket(Connection::WPtr conn) : net::SocketDevice(bt::UTP), conn(conn), blocking(true), polled_for_reading(false), polled_for_writing(false) { Connection::Ptr ptr = conn.toStrongRef(); if (ptr) { setRemoteAddress(ptr->remoteAddress()); ptr->setBlocking(blocking); m_state = CONNECTED; } }