X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fsocket_wrapper.cpp;h=313f6ca4b3c818635b95d024a9c1e38787fe00d6;hp=ac88144433c32930c08be2a92b3e89f3f0602406;hb=487afb796c9547de4353c503939b6666f8e0877d;hpb=3b2543e7dfd705d6e624560dd5a681898c0f242c diff --git a/src/socket_wrapper.cpp b/src/socket_wrapper.cpp index ac88144..313f6ca 100644 --- a/src/socket_wrapper.cpp +++ b/src/socket_wrapper.cpp @@ -25,6 +25,7 @@ namespace libt2n { +/// return active connection, create new tcp or unix connection if not existing client_connection* BasicSocketWrapper::get_connection(void) { if (c.get() == NULL) @@ -40,6 +41,8 @@ client_connection* BasicSocketWrapper::get_connection(void) 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; @@ -82,6 +85,7 @@ bool ReconnectSocketWrapper::handle(command_client* stubBase, boost::function< v 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(); @@ -97,6 +101,7 @@ client_connection* ReconnectIgnoreFailureSocketWrapper::get_connection(void) return tmp; } +/// try to execute the command, may bool ReconnectIgnoreFailureSocketWrapper::handle(command_client* stubBase, boost::function< void() > f) { if (!connection_established())