예제 #1
0
	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;
	}
예제 #2
0
	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;
		}
	}
예제 #3
0
	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;
		}
	}