59 void shutdown(std::string text =
"unknown");
83 bool eventReceived(
struct epoll_event event,
long long eventId);
90 void write(
char *buffer,
int length);
92 void output(std::stringstream &out);
104 virtual void onUnregister();
118 volatile bool shutDown =
false;
124 void setBufferSize(
int length);
163 virtual void receiveData(coreutils::ZString &buffer);
171 bool readHangup =
false;
172 volatile bool inHandler =
false;
191 std::queue<std::string> fifo;
int getDescriptor()
Get the descriptor for the socket.
Definition: Socket.cpp:46
bool eventReceived(struct epoll_event event, long long eventId)
Parse epoll event and call specified callbacks.
Definition: Socket.cpp:70
virtual void onRegistered()
Called after the socket has been registered with epoll processing.
Definition: Socket.cpp:64
virtual void receiveData(coreutils::ZString &buffer)
Definition: Socket.cpp:102
Socket(EPoll &ePoll, std::string text="")
Definition: Socket.cpp:12
int write(std::string data, Socket *sender=NULL)
Definition: Socket.cpp:147
virtual void onRegister()
Called before the socket has registered with the epoll processing.
Definition: Socket.cpp:62
virtual ~Socket()
Definition: Socket.cpp:18
void setDescriptor(int descriptor)
Set the descriptor for the socket.
Definition: Socket.cpp:30
virtual void onDataReceived(std::string data)
Called when data is received from the socket.
Definition: Socket.cpp:92
virtual void onUnregistered()
Called when the socket has finished unregistering for the epoll processing.
Definition: Socket.cpp:68
void shutdown(std::string text="unknown")
Definition: Socket.cpp:168