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
64 lines
1.8 KiB
#ifndef __SOCKETTRANSPORT_H_INCL__
|
|
#define __SOCKETTRANSPORT_H_INCL__
|
|
|
|
#include "../../components/base/basicDualThread.h"
|
|
#include "../../components/base/basicTransport.h"
|
|
|
|
#define MAXIMAL_SOCKET_PACKET_LENGTH 102400
|
|
|
|
/**
|
|
* TODO: Add class description
|
|
*
|
|
* @author Gagua
|
|
*/
|
|
class transportSocket : public basicTransport, public basicDualThread {
|
|
private:
|
|
basicLogCollection *m_pLog;
|
|
protected:
|
|
//U8 *m_pInputBuffer;
|
|
//U8 *m_pOutputBuffer;
|
|
U8 m_pInputBuffer[MAXIMAL_SOCKET_PACKET_LENGTH];
|
|
U8 m_pOutputBuffer[MAXIMAL_SOCKET_PACKET_LENGTH];
|
|
int m_nInputBufferSize;
|
|
int m_nOutputBufferSize;
|
|
|
|
virtual void m_fThreadAProc(void);
|
|
virtual void m_fThreadBProc(void);
|
|
virtual int sendBlock(unsigned char *Data, int DataSize){ return 0; };
|
|
virtual int recptBlock(unsigned char *Buffer, int *BufferLength){ return 0; };
|
|
public:
|
|
// Constructor
|
|
transportSocket();
|
|
|
|
// Destructor
|
|
virtual ~transportSocket();
|
|
|
|
// Copy constructor
|
|
// TODO: Uncomment the copy constructor when you need it.
|
|
//transportSocket(const socketTransport& src);
|
|
|
|
// Assignment operator
|
|
// TODO: Uncomment the assignment operator when you need it.
|
|
//transportSocket& operator=(const transportSocket& src);
|
|
bool sendData(unsigned char *Data, int DataSize);
|
|
};
|
|
|
|
// TODO: Uncomment the copy constructor when you need it.
|
|
//inline transportSocket::transportSocket(const socketTransport& src)
|
|
//{
|
|
// // TODO: copy
|
|
//}
|
|
|
|
// TODO: Uncomment the assignment operator when you need it.
|
|
//inline transportSocket& transportSocket::operator=(const transportSocket& rhs)
|
|
//{
|
|
// if (this == &rhs) {
|
|
// return *this;
|
|
// }
|
|
//
|
|
// // TODO: assignment
|
|
//
|
|
// return *this;
|
|
//}
|
|
|
|
#endif // __SOCKETTRANSPORT_H_INCL__
|