Browse Source

fixed string vs. buffer issue

tristangurtler 3 years ago
parent
commit
fbc7bb0652
1 changed files with 3 additions and 6 deletions
  1. 3 6
      prsona/src/orchestratorMain.cpp

+ 3 - 6
prsona/src/orchestratorMain.cpp

@@ -32,12 +32,9 @@ int clients_websocket_data_handler(
         struct synchronization_tool *sync = (struct synchronization_tool *) user_data;
 
         unique_lock<mutex> lck(sync->mtx);
-        stringstream buffer;
-        buffer << data;
-        BinarySizeT numClients;
-        buffer >> numClients;
-        std::cout << "raw data from websocket on number clients: " << numClients.val() << std::endl;
-        sync->val = numClients.val();
+        
+        if (data_len == sizeof(sync->val))
+            sync->val = *((size_t *) data);
 
         return false;
     }