public void onSocketConnectionStateChanged(object sender, PonyboxClient.SocketConnectionEvent e) { if (e.isConnected) { connected++; /* * Thread t = new Thread(new ThreadStart((MethodInvoker)delegate * { * while (true) * { * ((PonyboxClient)sender).SendMessage("rp", "message", "nightmane"); * Thread.Sleep(100); * } * * })); * * t.Start(); * * threadPool.Add(t); */ } else { disconnected++; } labelStarted.Invoke((MethodInvoker) delegate { labelStarted.Text = connected + " / " + disconnected + " (" + (connected - disconnected) + ")"; }); }
public void onSocketConnectionStateChanged(object sender, PonyboxClient.SocketConnectionEvent e) { if (!e.isConnected) { Console.WriteLine("Chatbox disconnected"); initCB(credentials); } }