Diff of /src/org/esb/rpc/Server.cpp [c8ba76] .. [b7a122]  Maximize  Restore

Switch to side-by-side view

--- a/src/org/esb/rpc/Server.cpp
+++ b/src/org/esb/rpc/Server.cpp
@@ -16,6 +16,7 @@
 #include "org/esb/io/ObjectOutputStream.h"
 
 #include "org/esb/hive/job/ProcessUnit.h"
+#include "services/ApiServiceImpl.h"
 namespace org {
   namespace esb {
     namespace rpc {
@@ -49,7 +50,7 @@
 
       Server::Server(int port) : _port(port) {
         registerService(new ConcreteDiscoveryService(this));
-        //registerService(new NodeServiceImpl());
+        registerService(new ApiServiceImpl(this));
         //registerService(new ProcessUnitServiceImpl(this));
       }
 
@@ -67,7 +68,7 @@
         try {
           _server = new org::esb::net::TcpServerSocket(_port);
           _server->bind();
-
+          LOGDEBUG("RpcServer started and listen in "<<_port);
           for (; true;) {
             org::esb::net::TcpSocket * clientSocket = _server->accept();
             boost::thread(boost::bind(&Server::handleClient, this, clientSocket));
@@ -84,6 +85,8 @@
 
       void Server::handleClient(org::esb::net::TcpSocket* s) {
         while (s->isConnected()) {
+          LOGDEBUG(boost::this_thread::get_id());
+
           std::string buffer;
           s->getInputStream()->read(buffer);
           if (!s->isConnected())return;
@@ -117,7 +120,7 @@
             if(!request->ParseFromString(rpcRequest.request_proto())){
               LOGERROR("an error occoured");
             }
-            LOGDEBUG("RequestProto:" << rpcRequest.request_proto());
+            //LOGDEBUG("RequestProto:" << rpcRequest.request_proto());
             /*
             RPCCompletionStatus *completionStatus = new RPCCompletionStatus;
             completionStatus->rpcController = &controller;