26 #ifndef __NETWORK__TCP_CONNECTION_H__INCL__
27 #define __NETWORK__TCP_CONNECTION_H__INCL__
170 virtual bool SendData(
char* errbuf = 0 );
178 virtual bool RecvData(
char* errbuf = 0 );
Simple wrapper for sockets.
virtual ~TCPConnection()
Cleans connection up.
const uint32 TCPCONN_RECVBUF_SIZE
void WaitLoop()
Blocks calling thread until working thread terminates.
virtual bool RecvData(char *errbuf=0)
Receives data and puts them into receive queue.
virtual bool SendData(char *errbuf=0)
Sends data in send queue.
Common wrapper for platform-specific mutexes.
virtual void ClearBuffers()
Clears send and receive buffers.
bool Send(Buffer **data)
Enqueues data to be sent.
TCPConnection()
Creates new connection in STATE_DISCONNECTED.
static const uint32 TCPCONN_ERRBUF_SIZE
Generic class for buffers.
void StartLoop()
Starts working thread.
virtual bool Process()
Does all stuff that needs to be periodically done to keep connection alive.
Generic class for TCP connections.
std::deque< Buffer * > mSendQueue
void AsyncConnect(uint32 rIP, uint16 rPort)
Schedules asynchronous connect to specified address.
bool Connect(uint32 rIP, uint16 rPort, char *errbuf=0)
Connects to specified address.
const uint32 TCPCONN_LOOP_GRANULARITY
void Disconnect()
Schedules disconnect of current connection.
void DoDisconnect()
Disconnects socket.
void TCPConnectionLoop()
Loop for worker threads.
virtual bool ProcessReceivedData(char *errbuf=0)=0
Processes received data.