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.

33 lines
922 B

7 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. void m_fThreadAProc(void);
  15. void m_fThreadBProc(void);
  16. protected:
  17. U8 * m_pInputBuffer;
  18. int m_nInputBufferSize;
  19. U8 * m_pOutputBuffer;
  20. int m_nOutputBufferSize;
  21. virtual int sendBlock(unsigned char *Data, int DataSize){ return 0; };
  22. virtual int recptBlock(unsigned char *Buffer, int *BufferLength){ return 0; };
  23. public:
  24. transportSocket();
  25. virtual ~transportSocket();
  26. bool sendData(unsigned char *Data, int DataSize);
  27. };
  28. #endif // __SOCKETTRANSPORT_H_INCL__