示例#1
0
void Server::sendStateToConnection(Connection::Ptr const& connection)
{
  BOOST_FOREACH(Connection::Ptr const& conn, connectionPool_) {
    connection->send(Message<MessageType::updateReadiness>(
        {conn->id(), conn->ready()}
    ));
  }
示例#2
0
	int UTPSocket::send(const bt::Uint8* buf, int len)
	{
		Connection::Ptr ptr = conn.toStrongRef();
		if (!ptr)
			return -1;

		try
		{
			return ptr->send(buf, len);
		}
		catch (Connection::TransmissionError & err)
		{
			close();
			return -1;
		}
	}