zeromq 发布订阅 无数据丢失性能测试

sub接收端代码:

#include 
#include 
#include 
#include 

using namespace std;
#define BAG_LARGE_NUM			14

long long int gettime(){  
	struct timeval tv = {0, 0};  
	gettimeofday(&tv, NULL);  
	return tv.tv_sec * 1000000 + tv.tv_usec;  
}

int main(int vArgc, char** vArgv)
{
	char* ProtocoltConSub			= vArgv[1];
	char* ProtocoltConReq			= vArgv[2];
	cout<<"ProtocoltConSub: "<
./Client tcp://localhost:5555 tcp://localhost:5556
pub发布端代码:

#include 
#include 
#include 

using namespace std;
#define BAG_LARGE_NUM			14

long long int gettime(){  
	struct timeval tv = {0, 0};  
	gettimeofday(&tv, NULL);  
	return tv.tv_sec * 1000000 + tv.tv_usec;  
}

int main(int vArgc, char** vArgv)
{
	char* tProtocolPub		= vArgv[1];
	char* tProtocolRep		= vArgv[2];
	int tClientNum			= atoi(vArgv[3]);
	long long tLoopL		= atoi(vArgv[4]);
	long long tLoopB		= atoi(vArgv[5]);

	cout<<"tProtocolPub: "<

脚本命令:./Server tcp://*:5555 tcp://*:5556 3 10000 100000

你可能感兴趣的:(zeromq学习)