1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- //ClientTunnel.h
- ///////////////////////////////////////////////////////////////////////////////
- #ifndef _CLIENT_TUNNEL_H_
- #define _CLIENT_TUNNEL_H_
- #ifdef VC60
- #if defined(__cplusplus)
- extern "C" {
- #endif //#if defined(__cplusplus)
- #include "netMain.h"
- #include "protocolhdr.h"
- #include "struct_def.h"
-
- class CClientTunnel : public CTransportImpl
- {
- public:
- CClientTunnel();
- virtual ~CClientTunnel();
- public:
- int net_OpenSocket(IN ETransportType eType,
- IN unsigned short usPort,
- IN LPTRANSPORT_EVENT eventHandler,
- void *pContext);
- void net_CloseSocket();
- int net_Connect(IN unsigned long ulIPValue, IN unsigned short usPort);
- unsigned long net_Send(IN void *pHeader,
- IN void *pMessage,
- IN unsigned long ulDataLen);
- public:
- LPTRANSPORT_EVENT m_eventHandler;
- void *m_pContext;
- private:
- SOCKET m_hSocket;
- };
- #if defined(__cplusplus)
- }
- #endif //#if defined(__cplusplus)
- #else
- //#include ".\NetWork\data_def.h"
- #include ".\include\IClientImpl.h"
- class CClientTunnel
- {
- public:
- CClientTunnel();
- virtual ~CClientTunnel();
- public:
- static TransportStatus Transport_Init();
- static TransportStatus Transport_UnInit();
- int net_OpenSocket(
- IN CONST ETransportType& eType,
- IN CONST unsigned short& usPort,
- IN LPTRANSPORT_EVENT eventHandler,
- void *pContext);
- void net_CloseSocket();
- int net_Connect(IN LPCTSTR strAddr, IN LPCTSTR strPort);
- int net_Connect(IN LPCTSTR strAddr, IN CONST DWORD& dwPort);
- unsigned long net_Send(
- IN void *pHeader,
- IN void *pMessage,
- IN CONST unsigned long& ulDataLen);
- public:
- LPTRANSPORT_EVENT m_eventHandler;
- void* m_pContext;
- private:
- INT m_nIndex;
- IClientImpl m_Client;
- };
- #endif //#ifdef VC60
- /*/////////////////////////////////////////////////////////////////////////*/
- #endif /*_CLIENT_TUNNEL_H_*/
|