title: Real time C# websockets client to use with Unity3D?
body: <p>I'm building a Unity3D client in C# for a multiplayer game that I made. The server is written in Node.js, and I wrote a web client in Javascript that works well. But I am running into lag issues with my Unity3D client implementation. I am using the <a href="https://github.com/sta/websocket-sharp" rel="noreferrer">websocket-sharp</a> library, but have been unable to use it in the same way as I did on my Javascript client with the HTML5 Websocket class. I believe the issue lies in the way the websocket-sharp library is made, currently each Send() will cause a lock to _forSend, so the data will transmit like this:</p>
  
  <pre><code>data1:frg1
  
  data1:frg2
  
  data2:frg1
  
  data2:frg2
  
  ...
  </code></pre>
  
  <p>But on my working javascript implementation, it looks like this as it is truly multithreaded:</p>
  
  <pre><code>data1:frg1
  
  data2:frg1
  
  data2:frg2
  
  data1:frg2
  </code></pre>
  
  <p>Therefore I believe this is the cause of my lag with my C# Unity implementation, because the websockets-sharp library behaves like this. Can anyone confirm that this is an issue with the websockets-sharp library or suggest a library that would work?</p>