46 void shutdown(std::string text =
"unknown");
61 int & operator = (
const int &i) {
return value = i; }
62 operator int ()
const {
return value; }
82 int write(std::string data);
83 void write(
char *buffer,
int length);
85 void output(std::stringstream &out);
95 virtual void onRegistered();
114 bool shutDown =
false;
116 void setBufferSize(
int length);
149 virtual void receiveData(
char *buffer,
int bufferLength);
157 bool readHangup =
false;
182 std::queue<std::string> fifo;
virtual void onDataReceived(std::string data)
Called when data is received from the socket.
Definition: Socket.cpp:99
virtual void receiveData(char *buffer, int bufferLength)
Definition: Socket.cpp:107
virtual void onUnregister()
Called when the socket has finished unregistering for the epoll processing.
Definition: Socket.cpp:59
Definition: Command.cpp:4
int write(std::string data)
Definition: Socket.cpp:156
bool eventReceived(struct epoll_event event, pid_t threadId)
Parse epoll event and call specified callbacks.
Definition: Socket.cpp:61
void setDescriptor(int descriptor)
Set the descriptor for the socket.
Definition: Socket.cpp:30
virtual void onRegister()
Called when the socket has finished registering with the epoll processing.
Definition: Socket.cpp:55
int getDescriptor()
Get the descriptor for the socket.
Definition: Socket.cpp:46
void shutdown(std::string text="unknown")
Definition: Socket.cpp:177