www.pudn.com > IPServer.rar > server.h
#ifndef __SERVER_H__
#define __SERVER_H__
#ifdef SERVER_EXPORTS
#define SERVER_API __declspec(dllexport)
#else
#define SERVER_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
enum SERVER_STATE
{
StartingUpState,
RunningState,
RefusingConnectionsState,
FatalErrorState,
ShuttingDownState
};
//bAdd false表示断开一device连接 此时URL为NULL,true表示增加一个device
typedef int(*CBF_NotifyANewConnection)(bool badd,const char* deviceip,const char* devicename,const char* deviceid,
const char* netcardid, unsigned short port);
//获取一个设备的地址信息
typedef int(*CBF_GetADeviceIP)(int command,int *Result, char** ipaddr,char *deviceid,int idlen,char*devicename, int devicelen );
SERVER_API int InitStreamServerLib(void);
SERVER_API int FiniStreamServerLib(void);
SERVER_API int StartServer(unsigned short deviceport = 7070,unsigned short clientport = 7071);
SERVER_API int RunServer();
SERVER_API int RunServerLoop();
SERVER_API int StopServer();
//new function
SERVER_API int SetNewConnectionCallBack(CBF_NotifyANewConnection callback);
SERVER_API int SetGetDeviceIdCallBack(CBF_GetADeviceIP callback);
#ifdef __cplusplus
}
#endif
#endif