ClientTunnel.h 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //ClientTunnel.h
  2. ///////////////////////////////////////////////////////////////////////////////
  3. #ifndef _CLIENT_TUNNEL_H_
  4. #define _CLIENT_TUNNEL_H_
  5. #include "netMain.h"
  6. #include "protocolhdr.h"
  7. #include "struct_def.h"
  8. class CClientTunnel : public CTransportImpl
  9. {
  10. public:
  11. CClientTunnel();
  12. // static CClientTunnel *GetInstance()
  13. // {
  14. // if ( m_pInstance == NULL )
  15. // m_pInstance = new CClientTunnel;
  16. //
  17. // return m_pInstance;
  18. // }
  19. virtual ~CClientTunnel();
  20. public:
  21. int net_OpenSocket(
  22. IN ETransportType eType,
  23. IN unsigned short usPort,
  24. IN LPTRANSPORT_EVENT eventHandler,
  25. void *pContext);
  26. void net_CloseSocket();
  27. int net_Connect(IN unsigned long ulIPValue, IN unsigned short usPort);
  28. unsigned long net_Send(
  29. IN void *pHeader,
  30. IN void *pMessage,
  31. IN unsigned long ulDataLen);
  32. public:
  33. LPTRANSPORT_EVENT m_eventHandler;
  34. void *m_pContext;
  35. private:
  36. static CClientTunnel* m_pInstance;
  37. SOCKET m_hSocket;
  38. public:
  39. };
  40. #endif /*_CLIENT_TUNNEL_H_*/