namespace libt2n
{
+/// set logging for coming and current connections
+void BasicSocketWrapper::set_logging(std::ostream *_logstream, log_level_values _log_level)
+{
+ ConnectionWrapper::set_logging(_logstream,_log_level);
+
+ if (connection_established())
+ get_connection()->set_logging(_logstream,_log_level);
+}
+
+
+/// return active connection, create new tcp or unix connection if not existing
client_connection* BasicSocketWrapper::get_connection(void)
{
if (c.get() == NULL)
return c.get();
}
+/// try to reconnect max_retries time if we encounter a t2n_communication_error
+/// during execution of the command
bool ReconnectSocketWrapper::handle(command_client* stubBase, boost::function< void() > f)
{
int tries=0;
return false;
}
+/// return active connection, return a dummy-connection if we can't establish one
client_connection* ReconnectIgnoreFailureSocketWrapper::get_connection(void)
{
client_connection* tmp=BasicSocketWrapper::get_connection();
return tmp;
}
+/// try to execute the command, may ignore the command if server not available
bool ReconnectIgnoreFailureSocketWrapper::handle(command_client* stubBase, boost::function< void() > f)
{
if (!connection_established())