当前位置: 首页>>代码示例>>C++>>正文


C++ EndPoint::toString方法代码示例

本文整理汇总了C++中EndPoint::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ EndPoint::toString方法的具体用法?C++ EndPoint::toString怎么用?C++ EndPoint::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EndPoint的用法示例。


在下文中一共展示了EndPoint::toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createConnection

ConnectionBasePtr TransferNode::createConnection(const PacketBasePtr &packet_base, const EndPoint &ep) {
	PacketHeader::PACKET_ID_TYPE packet_id = packet_base->header.getPacketID();
	if (packet_id == OpenConnection_ID) {
		INFO_LOG("Server: new connection from: " << ep.toString());
		Poco::SharedPtr<OpenConnectionPacket> packet = packet_base.cast<OpenConnectionPacket>();
		assert(packet.get());
		ConnectionBasePtr pConn(new ServerConnection(packet->OpenConnection.Code, ep, this->packet_serializer, *this));
		return pConn;
	} else if (packet_id == OpenConnectionReply_ID) {
		INFO_LOG("Client: new connection to: " << ep.toString());
		Poco::SharedPtr<OpenConnectionReplyPacket> packet = packet_base.cast<OpenConnectionReplyPacket>();
		ConnectionBasePtr pConn(new ClientConnection(packet->OpenConnectionReply.Code, ep, this->packet_serializer, *this));
		return pConn;
	} else {
		throw Poco::ApplicationException("unexpected packet type: ", packet_base->header.getPacketID()); // TODO @@@ ???
	}
}
开发者ID:lulurun,项目名称:fanni,代码行数:17,代码来源:TransferNode.cpp

示例2: onDisconnected

void TransferNode::onDisconnected(const void* pSender, const EndPoint &ep) {
	INFO_LOG("disconnected from: " << ep.toString());
	this->disconnected.set();
}
开发者ID:lulurun,项目名称:fanni,代码行数:4,代码来源:TransferNode.cpp

示例3: onConnectionRemoved

void TransferNode::onConnectionRemoved(const void* pSender, const EndPoint &ep) {
	INFO_LOG("removed connection from: " << ep.toString());
}
开发者ID:lulurun,项目名称:fanni,代码行数:3,代码来源:TransferNode.cpp

示例4: onConnected

void TransferNode::onConnected(const void* pSender, const EndPoint &ep) {
	INFO_LOG("connected to: " << ep.toString());
	this->connected.set();
}
开发者ID:lulurun,项目名称:fanni,代码行数:4,代码来源:TransferNode.cpp

示例5: onConnectionAdded

void TransferNode::onConnectionAdded(const void* pSender, const EndPoint &ep) {
	INFO_LOG("added new connection from: " << ep.toString());
}
开发者ID:lulurun,项目名称:fanni,代码行数:3,代码来源:TransferNode.cpp


注:本文中的EndPoint::toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。