32 class Socket :
public std::streambuf,
52 int & operator = (
const int &i) {
return value = i; }
53 operator int ()
const {
return value; }
73 void write(std::string data);
74 void write(
char *buffer,
int length);
76 void output(std::stringstream &out);
100 bool shutDown =
false;
102 void setBufferSize(
int length);
112 virtual void onTLSInit();
135 virtual void receiveData(
char *buffer,
int bufferLength);
141 bool readHangup =
false;
143 struct epoll_event event;
154 void resetReadWrite();
178 std::queue<std::string> fifo;
virtual void receiveData(char *buffer, int bufferLength)
Definition: Socket.cpp:87
virtual void onUnregistered()
Called when the socket has finished unregistering for the epoll processing.
Definition: Socket.cpp:44
Definition: Command.cpp:4
void enable(bool mode)
Enable the socket to read or write based upon buffer.
Definition: Socket.cpp:71
virtual void onDataReceived(std::string data)=0
Called when data is received from the socket.
void setDescriptor(int descriptor)
Set the descriptor for the socket.
Definition: Socket.cpp:21
void write(std::string data)
Definition: Socket.cpp:132
void eventReceived(struct epoll_event event)
Parse epoll event and call specified callbacks.
Definition: Socket.cpp:48
int getDescriptor()
Get the descriptor for the socket.
Definition: Socket.cpp:29
virtual void onRegistered()
Called when the socket has finished registering with the epoll processing.
Definition: Socket.cpp:40
virtual void onConnected()
Called when socket is open and ready to communicate.
Definition: Socket.cpp:119