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


C++ PacketWriter::reset方法代码示例

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


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

示例1: WriteCRC

void RTMFP::WriteCRC(PacketWriter& packet) {
	// Compute the CRC and add it at the beginning of the request
	PacketReader reader(packet.begin(),packet.length());
	reader.next(6);
	UInt16 sum = CheckSum(reader);
	packet.reset(4);packet << sum;
}
开发者ID:191919,项目名称:Cumulus,代码行数:7,代码来源:RTMFP.cpp

示例2: Encode

void RTMFP::Encode(AESEngine& aesEncrypt,PacketWriter packet) {
	// paddingBytesLength=(0xffffffff-plainRequestLength+5)&0x0F
	int paddingBytesLength = (0xFFFFFFFF-packet.length()+5)&0x0F;
	// Padd the plain request with paddingBytesLength of value 0xff at the end
	packet.reset(packet.length());
	string end(paddingBytesLength,(UInt8)0xFF);
	packet.writeRaw(end);
	// Compute the CRC and add it at the beginning of the request
	PacketReader reader(packet);
	reader.next(6);
	UInt16 sum = CheckSum(reader);
	packet.reset(4);packet << sum;
	
	// Encrypt the resulted request
	reader.reset(4);
	aesEncrypt.process(reader.current(),reader.current(),reader.available());
}
开发者ID:agazso,项目名称:Cumulus,代码行数:17,代码来源:RTMFP.cpp

示例3: Encode

void RTMFP::Encode(AESEngine& aesEncrypt,PacketWriter& packet) {
	if(aesEncrypt.type != AESEngine::EMPTY) {
		// paddingBytesLength=(0xffffffff-plainRequestLength+5)&0x0F
		int paddingBytesLength = (0xFFFFFFFF-packet.length()+5)&0x0F;
		// Padd the plain request with paddingBytesLength of value 0xff at the end
		packet.reset(packet.length());
		string end(paddingBytesLength,(UInt8)0xFF);
		packet.writeRaw(end);
	}

	WriteCRC(packet);
	
	// Encrypt the resulted request
	aesEncrypt.process(packet.begin()+4,packet.begin()+4,packet.length()-4);
}
开发者ID:191919,项目名称:Cumulus,代码行数:15,代码来源:RTMFP.cpp

示例4: Pack

void RTMFP::Pack(PacketWriter& packet,UInt32 farId) {
	PacketReader reader(packet.begin(),packet.length());
	reader.next(4);
	packet.reset(0);
	packet.write32(reader.read32()^reader.read32()^farId);
}
开发者ID:191919,项目名称:Cumulus,代码行数:6,代码来源:RTMFP.cpp

示例5: Pack

void RTMFP::Pack(PacketWriter packet,UInt32 farId) {
	packet.reset();
	PacketReader reader(packet);
	reader.read32();
	packet.write32(reader.read32()^reader.read32()^farId);
}
开发者ID:agazso,项目名称:Cumulus,代码行数:6,代码来源:RTMFP.cpp


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