Пример #1
0
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();
}
Пример #2
0
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;
}
Пример #3
0
	void DestroyStream (std::shared_ptr<i2p::stream::Stream> stream)
	{
		if (stream)
			stream->Close ();
	}