private static void StartThread(object path) { string p = (string)path; Console.WriteLine(p); _client = new WebsocketClient(); WebsocketEvents.WebsocketEvent += OnWebsocketEvent; _client.StartAsync(p); if (_client.IsConnected) { Console.Write("Write"); } Thread.Sleep(2000); while (_client.IsConnected) { //string message = Console.ReadLine(); ClientSendMessage("hi"); Thread.Sleep(1); } }