X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=src%2Fplpbus%2FServerEventThread.cc;h=9660597bd971cdfcf277b2e12ac92b5f8a872cc9;hb=f6bd0d4fefd6459f2e8e5e7b813933be2d87dd47;hp=f0cb4dce2f2d6c87c3f0473a5d7f131ed6094cb7;hpb=a4cadd50e661871c819f9f253f3595cfba647aed;p=libplpbus.git diff --git a/src/plpbus/ServerEventThread.cc b/src/plpbus/ServerEventThread.cc index f0cb4dc..9660597 100644 --- a/src/plpbus/ServerEventThread.cc +++ b/src/plpbus/ServerEventThread.cc @@ -5,20 +5,20 @@ * Author: lamikr */ -////////////////////////////////////////////////////////////////////// - // A thread object used to server clients registered // using the plpbus_orb::OrbServer::register() method. +#include + #include "BusServer.hh" #include "ServerEventThread.hh" + using namespace std; using namespace plpbus; ServerEventThread::ServerEventThread(plpbus_orb::OrbClient_ptr client, - const char *msg, - int period, - OrbServerImpl *server_obj) -{ + const char *msg, + int period, + OrbServerImpl *server_obj) { this->_orb_client = plpbus_orb::OrbClient::_duplicate(client); this->_orb_msg = msg; this->_interval = period; @@ -26,8 +26,7 @@ ServerEventThread::ServerEventThread(plpbus_orb::OrbClient_ptr client, _orb_client->receive_event_message("event_listener_started"); } -void ServerEventThread::run(void* arg) -{ +void ServerEventThread::run(void* arg) { try { while(_server_obj->is_shutdown_pending() == 0) { omni_thread::sleep(_interval); @@ -35,8 +34,10 @@ void ServerEventThread::run(void* arg) } } catch(...) { - cout << "server_thread failed, could not connect to client!" << endl; + log_error("server_thread failed, could not connect to client!\n"); + } + log_debug("server_thread, closing\n"); + if (_server_obj != NULL) { + _server_obj->server_thread_closed(); } - cout << "server_thread, closing" << endl; - _server_obj->server_thread_closed(); }