void Server::ServeClient(std::shared_ptr<ISocket> clientSocket) { try { Serve(clientSocket); } catch(const std::exception& e) { std::lock_guard<std::mutex> guard(stderrMutex); std::cerr << e.what(); } clientSocket->Close(); }
bool CloseServiceHost() { console_.WriteLine("Closing StatelessServiceTypeHost ..."); auto error = host_->Close(); if (!error.IsSuccess()) { console_.WriteLine("Failed. ErrorCode={0}", error); return false; } else { console_.WriteLine("StatelessServiceTypeHost Closed."); } return true; }
void DestroyStream (std::shared_ptr<i2p::stream::Stream> stream) { if (stream) stream->Close (); }