svrlist.h

来自「跨操作系统的微型中间件」· C头文件 代码 · 共 50 行

H
50
字号

#ifndef _SVRLIST_H_
#define _SVRLIST_H_

#ifdef __Win32__
#pragma warning(disable:4786)
#endif


#include <vector>
#include "OSMutex.h"
#include "OSHeaders.h"


using  namespace	std;

class CSvrList;

extern CSvrList * g_svrList;

typedef struct  {
	char	strIP[20];
	UInt16  port;
}	svrListElem ;

class CSvrList
{
public:	
	
	static CSvrList*	GetInstance();
	static void			DelInstance();

	static UInt16		SetSvrList(char ** svr, UInt16 len);
	static Bool			AddSvr(char* svr, UInt16 port);
//	static UInt32		GetOneSvrAddrI( int readAtList);
	static char*		GetOneSvrAddrS( int readAtList);
	static UInt16		GetPort(int readAtList);
	static UInt16		GetSize() {return m_svrList.size();}
private:
	CSvrList();
	~CSvrList();
	static CSvrList*			m_pSvrList;	
	static vector<svrListElem>	m_svrList;	
	static OSMutex				m_svrListMutex;	
};

#endif


⌨️ 快捷键说明

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