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


C++ GetServiceType函数代码示例

本文整理汇总了C++中GetServiceType函数的典型用法代码示例。如果您正苦于以下问题:C++ GetServiceType函数的具体用法?C++ GetServiceType怎么用?C++ GetServiceType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: WTRACE

// SMsgDirG2ClearDataObjects::Unpack
// Virtual method from SmallMessage.  Extracts data from message buffer.
void
SMsgDirG2ClearDataObjects::Unpack(void)
{
	WTRACE("SMsgDirG2ClearDataObjects::Unpack");
	mClearTypes.clear();
	mKeyType = (GetMessageType() == WONMsg::DirG2ServiceClearDataObjects ? KT_SERVICE : KT_DIRECTORY);
	SMsgDirG2UpdateBase::Unpack();

	if ((GetServiceType() != WONMsg::SmallDirServerG2) ||
	    ((GetMessageType() != WONMsg::DirG2DirectoryClearDataObjects) &&
	     (GetMessageType() != WONMsg::DirG2ServiceClearDataObjects)))
	{
		WDBG_AH("SMsgDirG2ClearDataObjects::Unpack Not a DirG2ClearDataObjects message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
		                              "Not a DirG2ClearDataObjects message.");
	}

	UnpackKey(*this);
	unsigned short aCt = ReadShort();
	WDBG_LL("SMsgDirG2ClearDataObjects::Unpack Reading " << aCt << " entries.");

	for (int i=0; i < aCt; i++)
	{
		DataObject anObj;
		unsigned char aLen = ReadByte();
		if (aLen > 0)
			anObj.GetDataType().assign(reinterpret_cast<const unsigned char*>(ReadBytes(aLen)), aLen);
		mClearTypes.insert(anObj);
	}

	UnpackPeerData();
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:34,代码来源:SMsgDirG2ClearDataObjects.cpp

示例2: WTRACE

void MMsgRoutingUnsubscribeDataObject::Unpack(void)
{
	WTRACE("MMsgRoutingUnsubscribeDataObject::Unpack");
	RoutingServerMessage::Unpack();

	if (GetServiceType() != WONMsg::MiniRoutingServer || 
        GetMessageType() != WONMsg::RoutingUnsubscribeDataObject)
	{
		WDBG_AH("MMsgRoutingUnsubscribeDataObject::Unpack Not a RoutingUnsubscribeDataObject message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a RoutingUnsubscribeDataObject message.");
	}

	// read in the client/group id
	mLinkId = ReadClientOrGroupId();
	
	// read in the datatype length followed by the datatype itself
	unsigned char aDataTypeSize = ReadByte();
	mDataType.assign((unsigned char*)ReadBytes(aDataTypeSize), aDataTypeSize);
	
	// read in the flags
	unsigned char aFlags = ReadByte();
	mExactOrRecursiveFlag = ((aFlags & 0x01) != 0);
	mGroupOrMembersFlag   = ((aFlags & 0x02) != 0);
	
	WDBG_LL("MMsgRoutingUnsubscribeDataObject::Unpack Reading message data");
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:26,代码来源:MMsgRoutingUnsubDataObject.cpp

示例3: ParseBody

//[输入]buffer:待解析的数据,opt_num:选项数量
//[输出]无
void ParseBody(char *buffer, int opt_num) {
//	int m;
//	printf("body...\n");
//	for(m=0;m++;m<=32)
//	{
//		printf("%s",buffer[m]);
//	}
//	printf(".............\n");
	//首先判断服务类型
	char *service = NULL;
	service = GetServiceType(buffer);

	if (service != NULL) {
	//	cout<<"应用层数据解析OK!"<<endl;
	//	cout<<"服务类型 :"<<service<<endl;

		if (strcmp(service, "SERVICE_HTTP") == 0) {
		         //	HttpParse(buffer, opt_num);
		}
		else if (strcmp(service, "SERVICE_SMTP") == 0) {
					cout<<"应用层数据解析OK!"<<endl;
					cout<<"服务类型 :"<<service<<endl;
			       SmtpParse(buffer, opt_num);
			       cout<<"-----------------------解析完成 !"<<endl;
		}
		else  //其它应用层数据类型
		{
		//	cout << "-----其它类型应用层数据------" << endl;
		}

	//	cout<<"-----------------------解析完成 !"<<endl;
	}

	free(service);
}
开发者ID:funnybjzs,项目名称:PictureSteganalysisOnline,代码行数:37,代码来源:Parse.cpp

示例4: WTRACE

// TMsgCommQueryOptions::unpack
// Virtual method from TMessage.  Extracts data from message buffer.
void
TMsgCommQueryOptions::Unpack(void)
{
	WTRACE("TMsgCommQueryOptions::Unpack");
	mOptionList.clear();
	TMessage::Unpack();

	if ((GetServiceType() != WONMsg::CommonService) ||
	    (GetMessageType() != WONMsg::CommQueryOptions))
	{
		WDBG_AH("TMsgCommRehupOptions::Unpack Not a CommQueryOptions message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
		                              "Not a CommQueryOptions message.");
	}

	// Get num options
	unsigned short aCt = ReadShort();

	WDBG_LL("TMsgCommQueryOptions::Unpack Reading " << aCt << "entries.");
	for (int i=0; i < aCt; i++)
	{
		string aBuf;
		ReadString(aBuf);
		mOptionList.push_back(aBuf);
	}
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:28,代码来源:TMsgCommQueryOptions.cpp

示例5: WTRACE

// TMsgDirGetDirContents::Unpack
// Virtual method from TMessage.  Extracts data from message buffer.
void
TMsgDirGetDirContentsReply::Unpack(void)
{
	WTRACE("TMsgDirGetDirContentsReply::Unpack");
	TMessage::Unpack();

	if ((GetServiceType() != WONMsg::DirServer) ||
	    (GetMessageType() != WONMsg::DirGetDirContentsReply))
	{
		WDBG_AH("TMsgDirGetDirContentsReply::Unpack Not a DirGetDirContentsReply message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
		                              "Not a DirGetDirContentsReply message.");
	}

	WDBG_LL("TMsgDirGetDirContentsReply::Unpack Reading message data");
	mStatus = static_cast<ServerStatus>(static_cast<short>(ReadShort()));
	unsigned short anEntryCt = ReadShort();

	WDBG_LL("TMsgDirGetDirContentsReply::Unpack Reading " << anEntryCt << "entries.");
	mEntries.clear();
	for (int i=0; i < anEntryCt; i++)
	{
		DirServerEntry anEntry;
		UnpackEntry(anEntry);
		mEntries.push_back(anEntry);
	}
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:29,代码来源:TMsgDirGetDirContents.cpp

示例6: WTRACE

void MMsgRoutingModifyDataObject::Unpack(void)
{
	WTRACE("MMsgRoutingModifyDataObject::Unpack");
	RoutingServerMessage::Unpack();

	if (GetServiceType() != WONMsg::MiniRoutingServer || 
        GetMessageType() != WONMsg::RoutingModifyDataObject)
	{
		WDBG_AH("MMsgRoutingModifyDataObject::Unpack Not a RoutingModifyDataObject message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a RoutingModifyDataObject message.");
	}

	// read in the client/group id
	mLinkId = ReadClientOrGroupId();
	
	// read in the datatype size and then the datatype itself
	unsigned char aDataTypeSize = ReadByte();
	mDataType.assign((unsigned char*)ReadBytes(aDataTypeSize), aDataTypeSize);

	// read in the offset
	mOffset = ReadShort();

	// read in the IsInsert flag
	mIsInsert = ReadBool();
	
	// read in the data length followed by the data itself
	unsigned short aDataSize = ReadShort();
	mData.assign((unsigned char*)ReadBytes(aDataSize), aDataSize);

	WDBG_LL("MMsgRoutingModifyDataObject::Unpack Reading message data");
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:31,代码来源:MMsgRoutingModifyDataObject.cpp

示例7: WTRACE

// TMsgDirFindServiceReply::Unpack
// Virtual method from TMessage.  Extracts data from message buffer.
void
TMsgDirFindServiceReply::Unpack(void)
{
	WTRACE("TMsgDirFindServiceReply::Unpack");
	TMessage::Unpack();

	if ((GetServiceType() != WONMsg::DirServer) ||
	    (GetMessageType() != WONMsg::DirFindServiceReply))
	{
		WDBG_AH("TMsgDirFindServiceReply::Unpack Not a DirFindServiceReply message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
		                              "Not a DirFindServiceReply message.");
	}

	WDBG_LL("TMsgDirFindServiceReply::Unpack Reading message data");
	mStatus = static_cast<ServerStatus>(static_cast<short>(ReadShort()));

	// Service data only present if status is success
	if (mStatus == WONMsg::StatusCommon_Success)
	{
		mService.mType = DirServerEntry::EntryTypeService;
		ReadWString(mService.mPath);
		ReadWString(mService.mName);
		ReadWString(mService.mDisplayName);
		ReadWString(mService.mVersion);
		ReadWString(mService.mProtoName);
		ReadWString(mService.mProtoVersion);
		ReadWString(mService.mNetAddress);
		mService.mLifespan = ReadLong();
		mService.mCreated  = ReadLong();

		unsigned short aLen = ReadShort();
		mService.SetBlob(ReadBytes(aLen), aLen);
	}
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:37,代码来源:TMsgDirFindService.cpp

示例8: WTRACE

void MMsgRoutingGetUserListReply::Unpack(void)
{
	WTRACE("MMsgRoutingGetUserListReply::Unpack");
	RoutingServerMessage::Unpack();

	if (GetServiceType() != WONMsg::MiniRoutingServer || 
        GetMessageType() != WONMsg::RoutingGetUserListReply)
	{
		WDBG_AH("MMsgRoutingGetUserListReply::Unpack Not a RoutingGetUserListReply message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a RoutingGetUserListReply message.");
	}

	WDBG_LL("MMsgRoutingGetUserListReply::Unpack Reading message data");

	// read in the status
	mStatus = ReadShort();

	// read in the user count
	unsigned short aNumUsers = ReadShort();

	// read in the user list
	mUserList.clear();
	for (int iUser = 0; iUser < aNumUsers; iUser++)
	{
		UserData aUser;
		ReadUserName(aUser.mUserName);

		mUserList.push_back(aUser);
	}
}
开发者ID:vgck,项目名称:opendr2,代码行数:30,代码来源:MMsgRoutingGetUserList.cpp

示例9: WTRACE

void MMsgRoutingSendData::Unpack(void)
{
	WTRACE("MMsgRoutingSendData::Unpack");
	RoutingServerMessage::Unpack();

	if (GetServiceType() != WONMsg::MiniRoutingServer || 
        GetMessageType() != WONMsg::RoutingSendData)
	{
		WDBG_AH("MMsgRoutingSendData::Unpack Not a RoutingSendData message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a RoutingSendData message.");
	}

	WDBG_LL("MMsgRoutingSendData::Unpack Reading message data");

	// read in the flags
	unsigned char aFlags = ReadByte();
	mShouldSendReply     = ((aFlags & 0x01) != 0);
	mIncludeExcludeFlag  = ((aFlags & 0x02) != 0);

	// read in the message data
	unsigned short aDataSize = ReadShort();
	mData.assign(reinterpret_cast<const unsigned char*>(ReadBytes(aDataSize)), aDataSize);

	// read in the address list
	ReadAddresseeList(this);
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:26,代码来源:MMsgRoutingSendData.cpp

示例10: WTRACE

// MMsgObsSubscribeById::Unpack
// Virtual method from MiniMessage.  Extracts data from message buffer.
void
MMsgObsSubscribeById::Unpack(void)
{
	WTRACE("MMsgObsSubscribeById::Unpack");
	MiniMessage::Unpack();

	if ((GetServiceType() != WONMsg::MiniObsServer) ||
	    (GetMessageType() != WONMsg::ObsMsg_SubscribeById))
	{
		WDBG_AH("MMsgObsSubscribeById::Unpack Not a ObsSubscribeById message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
		                              "Not a ObsSubscribeById message.");
	}

	WDBG_LL("MMsgObsSubscribeById::Unpack Reading message data");

	mPublicationId = ReadLong();
	mSubscriberId = ReadLong();
	if (!mSubscriberId) // Optional parameters follow
	{
		ReadString(mSubscriberName);
		ReadWString(mSubscriberDescription);
		mConnectionType = (ConnectionTypeEnum)ReadShort();
		ReadString(mSubscriberAddress);
	}
}
开发者ID:vgck,项目名称:opendr2,代码行数:28,代码来源:MMsgObsSubscribeById.cpp

示例11: WTRACE

// SMsgDirG2ModifyService::Unpack
// Virtual method from SmallMessage.  Extracts data from message buffer.
void
SMsgDirG2ModifyService::Unpack(void)
{
	WTRACE("SMsgDirG2ModifyService::Unpack");
	SetKeyType(KT_SERVICE);
	SetExtended((GetMessageType() != WONMsg::DirG2ModifyService), (GetMessageType() == WONMsg::DirG2ModifyServiceEx));
	SMsgDirG2UpdateExtendBase::Unpack();

	if ((GetServiceType() != WONMsg::SmallDirServerG2) ||
	    ((GetMessageType() != WONMsg::DirG2ModifyService) &&
	     (GetMessageType() != WONMsg::DirG2ModifyServiceEx) &&
		 (GetMessageType() != WONMsg::DirG2ModifyServiceExObsolete)))
	{
		WDBG_AH("SMsgDirG2ModifyService::Unpack Not a DirG2ModifyService(Ex) message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
		                              "Not a DirG2ModifyService(Ex) message.");
	}

	mEntityFlags = ReadByte();
	UnpackKey(*this);
	ReadWString(mNewName);

	unsigned char aLen = ReadByte();
	WDBG_LL("SMsgDirG2ModifyService::Unpack Read New Addr len=" << aLen);
	if (aLen > 0)
		mNewNetAddress.assign(reinterpret_cast<const unsigned char*>(ReadBytes(aLen)), aLen);

	ReadWString(mNewDisplayName);
	mNewLifespan = ReadLong();
	UnpackExtended();
	UnpackPeerData();
}
开发者ID:vgck,项目名称:opendr2,代码行数:34,代码来源:SMsgDirG2ModifyService.cpp

示例12: WTRACE

void MMsgRoutingCreateGroup::Unpack(void)
{
	WTRACE("MMsgRoutingCreateGroup::Unpack");
	RoutingServerMessage::Unpack();

	if (GetServiceType() != WONMsg::MiniRoutingServer || 
        GetMessageType() != WONMsg::RoutingCreateGroup)
	{
		WDBG_AH("MMsgRoutingCreateGroup::Unpack Not a RoutingCreateGroup message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a RoutingCreateGroup message.");
	}

	WDBG_LL("MMsgRoutingCreateGroup::Unpack Reading message data");

	// read in group name
	ReadGroupName(mGroupName);
	
	// read in flags
	unsigned char aFlags = ReadByte();
	mIsPublic             = ((aFlags & 0x01) != 0);
	mAnnounceGroupChanges = ((aFlags & 0x02) != 0);

	// read in client count
	unsigned short aNumClients = ReadShort();

	// read in client list
	mClientList.clear();
	for (int iClient = 0; iClient < aNumClients; iClient++)
		mClientList.push_back(ReadClientId());
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:30,代码来源:MMsgRoutingCreateGroup.cpp

示例13: WTRACE

// SMsgDirG2GetNumEntitiesReply::Unpack
// Virtual method from SmallMessage.  Extracts data from message buffer.
void
SMsgDirG2GetNumEntitiesReply::Unpack(void)
{
	WTRACE("SMsgDirG2GetNumEntitiesReply::Unpack");
	SmallMessage::Unpack();

	if ((GetServiceType() != WONMsg::SmallDirServerG2) ||
	    (GetMessageType() != WONMsg::DirG2GetNumEntitiesReply))
	{
		WDBG_AH("SMsgDirG2GetNumEntitiesReply::Unpack Not a DirG2GetNumEntitiesReply message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
		                              "Not a DirG2GetNumEntitiesReply message.");
	}

	WDBG_LL("SMsgDirG2GetNumEntitiesReply::Unpack Reading message data");
	unsigned short anEntryCt = ReadShort();

	WDBG_LL("SMsgDirG2GetNumEntitiesReply::Unpack Reading " << anEntryCt << " entries.");
	mEntries.clear();
	for (int i=0; i < anEntryCt; i++)
	{
		NumEntriesData anEntry;
		mEntries.push_back(anEntry);
		mEntries.back().first  = static_cast<short>(ReadShort());
		mEntries.back().second = ReadShort();
	}
}
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:29,代码来源:SMsgDirG2GetNumEntities.cpp

示例14: WTRACE

void SMsgCommDumpStatistics::Unpack(void)
{
	WTRACE("SMsgCommDumpStatistics::Unpack");
	SmallMessage::Unpack();

	if (GetServiceType() != WONMsg::SmallCommonService ||
	    GetMessageType() != WONMsg::SmallCommDumpStatistics)
	{
		WDBG_AH("SMsgCommDumpStatistics::Unpack Not a SMsgCommDumpStatistics message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a SMsgCommDumpStatistics message.");
	}
}
开发者ID:vgck,项目名称:opendr2,代码行数:12,代码来源:SMsgCommDumpStatistics.cpp

示例15: WTRACE

void MMsgRoutingBecomeModerator::Unpack(void)
{
	WTRACE("MMsgRoutingBecomeModerator::Unpack");
	RoutingServerClientIdFlagMessage::Unpack();

	if (GetServiceType() != WONMsg::MiniRoutingServer || 
        GetMessageType() != WONMsg::RoutingBecomeModerator)
	{
		WDBG_AH("MMsgRoutingBecomeModerator::Unpack Not a RoutingBecomeModerator message!");
		throw WONMsg::BadMsgException(*this, __LINE__, __FILE__, "Not a RoutingBecomeModerator message.");
	}
}
开发者ID:vgck,项目名称:opendr2,代码行数:12,代码来源:MMsgRoutingBecomeModerator.cpp


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