important:
* PIThread::~PIThread() now unregister itself from introspection, if terminates than show warning * PISystemMonitor now correctly stops * PIPeer now can correctly stopAndWait * PIPeer::destroy(), protected method for close all eths and threads * new PIINTROSPECTION_STOP macro * Introspection now can be correctly stopped by macro, more safety ClientServer: * ClientBase::close() stop and disconnect channel * Server clients clean-up now event-based * No warnings on client destructor
This commit is contained in:
@@ -26,17 +26,18 @@ PIClientServer::ClientBase::ClientBase() {}
|
||||
|
||||
|
||||
PIClientServer::ClientBase::~ClientBase() {
|
||||
stop();
|
||||
close();
|
||||
if (own_tcp) piDeleteSafety(tcp);
|
||||
}
|
||||
|
||||
|
||||
void PIClientServer::ClientBase::stop() {
|
||||
void PIClientServer::ClientBase::close() {
|
||||
if (!tcp) return;
|
||||
can_write = false;
|
||||
tcp->interrupt();
|
||||
tcp->stopAndWait(10_s);
|
||||
if (tcp->isThreadedRead()) tcp->terminateThreadedRead();
|
||||
tcp->close();
|
||||
stream.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user