title: WebSocket Reconnect issue on network disconnection
body: <p>i am using below socket functions to receive data from socket server, when i disconnect my network connection , and reconnect again socket application stop receiving data. I also tried to add a timer which check the state of socket every 20 sec but its not working. Any advise?</p>
  
  <pre><code>private WebSocket client;  //before form_load
  
  private void Form1_Load(object sender, EventArgs e)
  {
      client = new WebSocket(host);
  
      client.OnOpen += (ss, ee) =&gt;
        {
           MessageBox.Show(string.Format("Connected to {0} successfully ", host));
        };
  
      client.OnError += (ss, ee) =&gt;
        {
           MessageBox.Show("     Error: " + ee.Message);
        };
  
      client.OnMessage += (ss, ee) =&gt;
        {
           MessageBox.Show("Message: " + ee.Message);
        };
  
      client.OnClose += (ss, ee) =&gt;
        {
          MessageBox.Show(string.Format("Disconnected with {0}", host));   
      };
  
      client.Connect();
  }
  
  private void timer1_Tick(object sender, EventArgs e)
   {
      if(client.ReadyState.ToString()=="Closed")
         {
            client.Close();
            client = new WebSocket(host);
            client.Connect();
         }
  
   }
  </code></pre>