⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 程序实现了在ip协议之上加一层RUDP协议
💻 CPP
字号:
// test.cpp: implementation of the test class.
//
//////////////////////////////////////////////////////////////////////

#include "test.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

test::test()
{
	
}

test::~test()
{
	
}

void print()
{
	
}
/*
int main(void)
{

	SOCKET_ACTIVITY_LIST_Handler a;
	int q;
	SOCKET_ACTIVITY_LIST_Handler* m_SOCKET_ACTIVITY_LIST_Handler=SOCKET_ACTIVITY_LIST_Handler::get_instance();
	cout<<m_SOCKET_ACTIVITY_LIST_Handler->f_activityNode_vector_length()<<endl;
	cout<<m_SOCKET_ACTIVITY_LIST_Handler->f_no_activityNode_vector_length()<<endl;
	cout<<"enter a int"<<endl;
	cin>>q;
	
	m_SOCKET_ACTIVITY_LIST_Handler->f_remove_activity_node_by_ip(q);
	cout<<m_SOCKET_ACTIVITY_LIST_Handler->f_activityNode_vector_length()<<endl;
	cout<<m_SOCKET_ACTIVITY_LIST_Handler->f_no_activityNode_vector_length()<<endl;

	Socket_SR* socket_sr_ptr=Socket_SR::get_instance();
	RUDP_EnUnPacket_Handler* rudp_enunpacket_ptr=RUDP_EnUnPacket_Handler::get_instance();
	socket_sr_ptr->socket_init();
	cout<<"begin"<<endl;
	socket_sr_ptr->receive();
	char* c=socket_sr_ptr->get_recvBuf();
	char* packet=rudp_enunpacket_ptr->f_unRUDPPacket(c);
	cout<<"packet="<<packet<<endl;
	RUDP* rudp=(RUDP*)c;
	cout<<"s_deviceID="<<rudp->S_deviceID<<endl;
	cout<<"d_deviceID="<<rudp->D_deviceID<<endl;

	char* data_p="abcbuli";
	Message message;
	SOCKET_Sequence_Manager* seq_manager_str=SOCKET_Sequence_Manager::get_instance();
	SOCKET_ReTransmit_Timing2_Protocol_Handler* r_transmit_str=SOCKET_ReTransmit_Timing2_Protocol_Handler::get_instance();
	seq_manager_str->add(5);
	cout<<"sequencelength="<<seq_manager_str->f_get_length()<<endl;
	cout<<"find deviceID=5: "<<seq_manager_str->f_get_sequence(5)<<endl;
	SOCKET_ACTIVITY_LIST_Handler* activity_str=SOCKET_ACTIVITY_LIST_Handler::get_instance();
	activity_str->f_introduce_no_activity_node_List();
	cout<<"novectorlength="<<activity_str->f_no_activityNode_vector_length()<<endl;
	cout<<"vectorlength="<<activity_str->f_activityNode_vector_length()<<endl;
	activity_str->f_add_activity_node_by_ip(1);
	cout<<"after add no activity to activity"<<endl;
	cout<<"novectorlength="<<activity_str->f_no_activityNode_vector_length()<<endl;
	cout<<"vectorlength="<<activity_str->f_activityNode_vector_length()<<endl;
	message.Device=1;
	message.Event=2;
	message.SubMsg=10;
	message.Length=100;
	message.DataPtr=data_p;
	message.Data[0]=5;
	message.Data[1]=0;
	cout<<"deviceID="<<message.Data[0]<<endl;
	SOCKET_Transmit_Protocol_Handler* transmit_str=SOCKET_Transmit_Protocol_Handler::get_instance();
	transmit_str->f_SOCKET_Transmit_Protocol_Handler(&message);





	int i =0,j=0;

	init();
	//sleep(10);
	sleep(50);
	while(i<20)
	{
		sleep(1);
		printf("here\n");	
		i++;   
	}
	del_s();


		SOCKET_Transmit_Protocol_Handler* transmit_str=SOCKET_Transmit_Protocol_Handler::get_instance();

		while(1)
	{

		printf("here\n");	
 
	}

	return 0;

}


*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -