ServerTunnel.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //ServerTunnel.h
  2. ///////////////////////////////////////////////////////////////////////////////
  3. #ifndef _SERVER_TUNNEL_H_
  4. #define _SERVER_TUNNEL_H_
  5. /*/////////////////////////////////////////////////////////////////////////* /
  6. #if defined(__cplusplus)
  7. extern "C" {
  8. #endif
  9. /*/////////////////////////////////////////////////////////////////////////*/
  10. #include "./include/netMain.h"
  11. #include "./include/protocolhdr.h"
  12. #include "./include/struct_def.h"
  13. /////////////////////////////////////////////////////////////////////////////
  14. class CServerTunnel : public CTransportImpl
  15. {
  16. public:
  17. CServerTunnel();
  18. virtual ~CServerTunnel();
  19. public:
  20. int net_OpenSocket(IN ETransportType eType,
  21. IN unsigned short usPort,
  22. IN LPTRANSPORT_EVENT eventHandler,
  23. void *pContext);
  24. void net_CloseSocket();
  25. int net_Connect(IN unsigned long ulIPValue, IN unsigned short usPort);
  26. unsigned long net_Send(IN SOCKET hSocket,
  27. IN void *pHeader,
  28. IN void *pMessage,
  29. IN unsigned long ulDataLen);
  30. unsigned long net_Send2(IN SOCKET hSocket,
  31. IN void *pHeader,
  32. IN void *pMessage,
  33. IN unsigned long ulDataLen);
  34. public:
  35. LPTRANSPORT_EVENT m_eventHandler;
  36. void *m_pContext;
  37. private:
  38. SOCKET m_hSocket;
  39. };
  40. /*/////////////////////////////////////////////////////////////////////////* /
  41. #if defined(__cplusplus)
  42. }
  43. #endif
  44. /*/////////////////////////////////////////////////////////////////////////*/
  45. #endif /*_SERVER_TUNNEL_H_*/