You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
8 years ago
​
​
​
8 years ago
​
​
​
8 years ago
​
8 years ago
  1. #ifndef __SOCKETTRANSPORT_H_INCL__
  2. #define __SOCKETTRANSPORT_H_INCL__
  3. #include "../../components/base/basicDualThread.h"
  4. #include "../../components/base/basicTransport.h"
  5. #define MAXIMAL_SOCKET_PACKET_LENGTH 102400
  6. /**
  7. * TODO: Add class description
  8. *
  9. * @author Gagua
  10. */
  11. class transportSocket : public basicTransport, public basicDualThread {
  12. private:
  13. basicLogCollection *m_pLog;
  14. protected:
  15. U8 m_pInputBuffer[MAXIMAL_SOCKET_PACKET_LENGTH];
  16. U8 m_pOutputBuffer[MAXIMAL_SOCKET_PACKET_LENGTH];
  17. int m_nInputBufferSize;
  18. int m_nOutputBufferSize;
  19. bool m_bInitComplete;
  20. virtual void m_fThreadAProc(void);
  21. virtual void m_fThreadBProc(void);
  22. virtual int sendBlock(unsigned char *Data, int DataSize){ return 0; };
  23. virtual int recptBlock(unsigned char *Buffer, int *BufferLength){ return 0; };
  24. public:
  25. transportSocket();
  26. virtual ~transportSocket();
  27. virtual bool sendData(unsigned char *Data, int DataSize);
  28. virtual bool reconnect( void ){ return false; };
  29. virtual bool create( void );
  30. };
  31. #endif // __SOCKETTRANSPORT_H_INCL__