for (;;) {
Socket::Ptr client = server->Accept();
- try {
- NewClientHandler(client, TlsRoleServer);
- } catch (const std::exception& ex) {
- std::stringstream message;
- message << "Error for new JSON-RPC socket: " << boost::diagnostic_information(ex);
- Log(LogInformation, "cluster", message.str());
- }
+ Utility::QueueAsyncCallback(bind(&ClusterComponent::NewClientHandler, this, client, TlsRoleServer));
}
}
TcpSocket::Ptr client = boost::make_shared<TcpSocket>();
- try {
- client->Connect(node, service);
- NewClientHandler(client, TlsRoleClient);
- } catch (const std::exception& ex) {
- Log(LogInformation, "cluster", "Could not connect to " + node + ":" + service + ": " + ex.what());
- }
+ client->Connect(node, service);
+ Utility::QueueAsyncCallback(bind(&ClusterComponent::NewClientHandler, this, client, TlsRoleClient));
}
/**