www.pudn.com > ITSever.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 
};    
 
typedef int(__stdcall *CBF_NotifyANewConnection)(bool badd,const char* clientip,unsigned short port, const char* url); 
//bAdd false表示断开一Client连接 此时URL为NULL,true表示增加一个Client 
 
SERVER_API int __stdcall InitStreamServerLib(void); 
SERVER_API int __stdcall FiniStreamServerLib(void); 
 
SERVER_API int __stdcall StartServer(const char* path,unsigned short port = 554); 
SERVER_API int __stdcall RunServer(); 
SERVER_API int __stdcall RunServerLoop(); 
SERVER_API int __stdcall StopServer(); 
SERVER_API int __stdcall GetServerState(); 
SERVER_API int __stdcall GetCurConnection(); 
SERVER_API int __stdcall GetCurChannel(); 
SERVER_API int __stdcall VodCreateIndex(char *filename,int len); 
SERVER_API int __stdcall SetNewConnectionCallBack(CBF_NotifyANewConnection callback); 
 
#ifdef __cplusplus 
} 
#endif 
 
#endif