18 this->reader = &reader;
19 this->callback = &callback;
26 if (reader !=
nullptr && callback !=
nullptr) {
27 while (!isStopping() && !reader->isClosed()) {
29 callback->
onRead(*(reader->lastRead()), *reader);
38 if (reader !=
nullptr) {
A mini-server for performing network communication in the background.
void onRead(T &datum) override
Callback method.
void interrupt() override
Interrupt any current reads or writes attached to the port.
void onStop() override
Call-back, called while halting the thread (before join).
void run() override
Main body of the new thread.