Skip to content
Snippets Groups Projects

Draft: Resolve "Unix Socket Server schreiben"

Merged Leon Dietrich requested to merge 3-unix-socket-server-schreiben into master
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
@@ -15,6 +15,7 @@ namespace rmrf::net {
if (this->server_active) {
io.stop();
this->net_socket.reset();
}
if (destructor_cb) {
@@ -31,7 +32,7 @@ namespace rmrf::net {
}
if (events & ::ev::READ) {
if(this->in_data_cb != nullptr)
if (this->in_data_cb != nullptr)
this->read_from_socket(w);
}
@@ -52,19 +53,27 @@ namespace rmrf::net {
if (partial_write_allowed)
this->write_queue.push_front(buffer);
this->data_write_active = false;
}
}
set_new_flags();
}
void connection_client::stop_server() {
this->server_active = false;
this->net_socket.reset();
this->write_queue.clear();
io.stop();
async.stop();
}
void connection_client::set_incomming_data_callback(const incomming_data_cb &cb) {
if (!this->server_active) {
return;
}
this->in_data_cb = cb;
this->async.send();
}
Loading