title: Not able to receive message in WebSocket client
body: <p>I am using <a href="http://websocket4net.codeplex.com/" rel="nofollow noreferrer">websocket4net</a> to create a WebSocket client in C# and communicate with a server. </p>
  
  <p>I am able to send data, but not able to receive the reply that the server is sending back. The <code>Client_MessageReceived</code> is not triggered at all. I am able to see the reply in WireShark though.</p>
  
  <p>The code I am using is as below :</p>
  
  <pre><code>class CommandRPC
  {
      public String jsonrpc;
      public String method;
      public Parameter @params;
      public String id;
  }    
  
  class Parameter
  {
      public String cmd;
  }
  
  class Program
  {
      static WebSocket Client;
  
      static CommandRPC command;
  
      static void Main(string[] args)
      {
          Client = new WebSocket("ws://10.131.35.32/DIAG");
          Client.Opened += new EventHandler(Client_Opened);
          Client.Error += new EventHandler&lt;SuperSocket.ClientEngine.ErrorEventArgs&gt;(Client_Error);
          Client.Closed += new EventHandler(Client_Closed);
          Client.MessageReceived += new EventHandler&lt;MessageReceivedEventArgs&gt;(Client_MessageReceived);
          Client.DataReceived += new EventHandler&lt;DataReceivedEventArgs&gt;(Client_DataReceived);
  
  
          command = new CommandRPC();
          command.jsonrpc = "2.0";
          command.method = "SystemExec";
          command.@params = new Parameter();
          command.@params.cmd = "ls";
          command.id = "8302144";
  
          Client.Open();
          System.Threading.Thread.Sleep(2000);
          Console.WriteLine(Client.State);
          Console.ReadLine();
      }
  
  
      static void Client_DataReceived(object sender, DataReceivedEventArgs e)
      {
          Console.WriteLine("DATA received : " + e.Data);
      }
  
      static void Client_MessageReceived(object sender, MessageReceivedEventArgs e)
      {
          Console.WriteLine("Message received : " + e.Message);            
      }
  
      static void Client_Closed(object sender, EventArgs e)
      {
          Console.WriteLine("Websocket closed");
      }
  
      static void Client_Error(object sender, SuperSocket.ClientEngine.ErrorEventArgs e)
      {
          Console.WriteLine("Error thrown trying to open websocket : " + e.Exception.Message);
      }
  
      static void Client_Opened(object sender, EventArgs e)
      {
          var json = new JavaScriptSerializer().Serialize(command);            
          Console.WriteLine("Websocket connection open.");
  
          for (int i = 1; i &lt;= 2; i++)
          {
              Console.WriteLine("Sending Json: " + i.ToString());
              Client.Send(json);
              System.Threading.Thread.Sleep(500);
          }   
      }
  }
  </code></pre>