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.

59 lines
1.7 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. virtual void m_fThreadAProc(void);
  20. virtual void m_fThreadBProc(void);
  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. // Copy constructor
  27. // TODO: Uncomment the copy constructor when you need it.
  28. //transportSocket(const socketTransport& src);
  29. // Assignment operator
  30. // TODO: Uncomment the assignment operator when you need it.
  31. //transportSocket& operator=(const transportSocket& src);
  32. bool sendData(unsigned char *Data, int DataSize);
  33. };
  34. // TODO: Uncomment the copy constructor when you need it.
  35. //inline transportSocket::transportSocket(const socketTransport& src)
  36. //{
  37. // // TODO: copy
  38. //}
  39. // TODO: Uncomment the assignment operator when you need it.
  40. //inline transportSocket& transportSocket::operator=(const transportSocket& rhs)
  41. //{
  42. // if (this == &rhs) {
  43. // return *this;
  44. // }
  45. //
  46. // // TODO: assignment
  47. //
  48. // return *this;
  49. //}
  50. #endif // __SOCKETTRANSPORT_H_INCL__