mirror of https://github.com/Icinga/icinga2.git
38 lines
698 B
C++
38 lines
698 B
C++
#ifndef I2_TCPCLIENT_H
|
|
#define I2_TCPCLIENT_H
|
|
|
|
namespace icinga
|
|
{
|
|
|
|
class TCPClient : public TCPSocket
|
|
{
|
|
private:
|
|
FIFO::RefType m_SendQueue;
|
|
FIFO::RefType m_RecvQueue;
|
|
|
|
int ReadableEventHandler(EventArgs::RefType ea);
|
|
int WritableEventHandler(EventArgs::RefType ea);
|
|
|
|
public:
|
|
typedef shared_ptr<TCPClient> RefType;
|
|
typedef weak_ptr<TCPClient> WeakRefType;
|
|
|
|
TCPClient(void);
|
|
|
|
virtual void Start(void);
|
|
|
|
void Connect(const char *hostname, unsigned short port);
|
|
|
|
FIFO::RefType GetSendQueue(void);
|
|
FIFO::RefType GetRecvQueue(void);
|
|
|
|
virtual bool WantsToRead(void) const;
|
|
virtual bool WantsToWrite(void) const;
|
|
|
|
event<EventArgs::RefType> OnDataAvailable;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* I2_TCPCLIENT_H */
|