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.

64 lines
1.8 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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. protected:
  15. //U8 *m_pInputBuffer;
  16. //U8 *m_pOutputBuffer;
  17. U8 m_pInputBuffer[MAXIMAL_SOCKET_PACKET_LENGTH];
  18. U8 m_pOutputBuffer[MAXIMAL_SOCKET_PACKET_LENGTH];
  19. int m_nInputBufferSize;
  20. int m_nOutputBufferSize;
  21. virtual void m_fThreadAProc(void);
  22. virtual void m_fThreadBProc(void);
  23. virtual int sendBlock(unsigned char *Data, int DataSize){ return 0; };
  24. virtual int recptBlock(unsigned char *Buffer, int *BufferLength){ return 0; };
  25. public:
  26. // Constructor
  27. transportSocket();
  28. // Destructor
  29. virtual ~transportSocket();
  30. // Copy constructor
  31. // TODO: Uncomment the copy constructor when you need it.
  32. //transportSocket(const socketTransport& src);
  33. // Assignment operator
  34. // TODO: Uncomment the assignment operator when you need it.
  35. //transportSocket& operator=(const transportSocket& src);
  36. bool sendData(unsigned char *Data, int DataSize);
  37. };
  38. // TODO: Uncomment the copy constructor when you need it.
  39. //inline transportSocket::transportSocket(const socketTransport& src)
  40. //{
  41. // // TODO: copy
  42. //}
  43. // TODO: Uncomment the assignment operator when you need it.
  44. //inline transportSocket& transportSocket::operator=(const transportSocket& rhs)
  45. //{
  46. // if (this == &rhs) {
  47. // return *this;
  48. // }
  49. //
  50. // // TODO: assignment
  51. //
  52. // return *this;
  53. //}
  54. #endif // __SOCKETTRANSPORT_H_INCL__