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.

65 lines
1.8 KiB

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