MCPcopy Create free account
hub / github.com/SmingHub/Sming / shutdown

Method shutdown

Sming/Components/Network/src/Network/TcpServer.cpp:148–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void TcpServer::shutdown()
149{
150 active = false;
151
152 debug_i("Shutting down the server ...");
153
154 if(tcp) {
155 tcp_arg(tcp, nullptr);
156 tcp_accept(tcp, nullptr);
157 tcp_close(tcp);
158
159 tcp = nullptr;
160 }
161
162 if(connections.count() == 0) {
163 delete this;
164 return;
165 }
166
167 for(auto& connection : connections) {
168 if(connection != nullptr) {
169 connection->setTimeOut(1);
170 }
171 }
172}
173
174void TcpServer::onClientDestroy(TcpConnection& connection)
175{

Callers 1

shutdownServerFunction · 0.45

Calls 2

setTimeOutMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected