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.

62 lines
1.7 KiB

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. void m_fThreadAProc(void);
  14. void m_fThreadBProc(void);
  15. basicLogCollection *m_pLog;
  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. void setConnectionStatus( CONNECTION_STATUS CS );
  24. public:
  25. // Constructor
  26. transportSocket();
  27. // Destructor
  28. virtual ~transportSocket();
  29. // Copy constructor
  30. // TODO: Uncomment the copy constructor when you need it.
  31. //transportSocket(const socketTransport& src);
  32. // Assignment operator
  33. // TODO: Uncomment the assignment operator when you need it.
  34. //transportSocket& operator=(const transportSocket& src);
  35. bool sendData(unsigned char *Data, int DataSize);
  36. };
  37. // TODO: Uncomment the copy constructor when you need it.
  38. //inline transportSocket::transportSocket(const socketTransport& src)
  39. //{
  40. // // TODO: copy
  41. //}
  42. // TODO: Uncomment the assignment operator when you need it.
  43. //inline transportSocket& transportSocket::operator=(const transportSocket& rhs)
  44. //{
  45. // if (this == &rhs) {
  46. // return *this;
  47. // }
  48. //
  49. // // TODO: assignment
  50. //
  51. // return *this;
  52. //}
  53. #endif // __SOCKETTRANSPORT_H_INCL__