title: Firing different sensor threads sends data to same socket?
body: <p>The closest question to my problem so far has been:
  <a href="https://stackoverflow.com/questions/1523916/how-to-handle-same-socket-in-different-threads">How to handle same socket in different threads?</a></p>
  
  <p>But it didn't help me in my pursuit. I have several sensor threads which are fired at random intervals to a client socket which in turn sends that data to the server socket.</p>
  
  <p>But I get the issue when the sensor threads are fired at the same time then the data of those threads get mixed up. I don't want that behavior to happen, I want all those threads to be fired distinctly without being fired at the same point at any time. Please give me methods in which achieve this. I can't seem to think of a good solution on my own.</p>
  
  <p>P.S. I am emulating a test branch environment where the sensors are fired in different threads (as if attached to client socket) to send data to this client on different topics than to the broker. When I use to sleep on the sensor threads and the data mixup still occurs at some point later on.</p>