public void StopLocalServer() { // Note: doesn't stop accepting connections, simply stops broadcasting if (LanMode) { PingThread.Abort(); } }
public void Quit(string reason) { foreach (var channel in Channels.Values) { channel.SendQuit(this, reason); } ListenThread.Abort(); PingThread.Abort(); TcpClient.Close(); }
private void BeginPing() { int i = 0; foreach (var item in speedData) { PingThread pingThread = new PingThread(i, item.server); pingThread.callBack = ThreadCallBack; Thread t = new Thread(new ThreadStart(pingThread.PingIp)); t.IsBackground = true; t.Start(); i++; } }
public bool Start() { if (!ListenThread.IsAlive) { Running = true; ListenThread.Start(); PingThread.Start(); return(true); } return(false); }
/// <exception cref="System.Exception"></exception> public virtual void Test() { if (IsEmbedded()) { // This test really doesn't make sense for MTOC, there // is no client to ping. return; } var dispatcher = ServerDispatcher(); var pingThread = new PingThread (dispatcher); pingThread.Start(); for (var i = 0; i < ItemCount; i++) { var item = new Item(i); Store(item); } Assert.AreEqual(ItemCount, Db().QueryByExample(typeof (Item )).Count); pingThread.Close(); }
/// <exception cref="System.Exception"></exception> public virtual void Test() { if (IsEmbedded()) { // This test really doesn't make sense for MTOC, there // is no client to ping. return; } var dispatcher = ServerDispatcher(); var pingThread = new PingThread (dispatcher); pingThread.Start(); for (var i = 0; i < ItemCount; i++) { var item = new Item(i); Store(item); } Assert.AreEqual(ItemCount, Db().QueryByExample(typeof(Item )).Count); pingThread.Close(); }
/// <summary> /// 关闭当前窗口执行的事件 /// </summary> private void CloseForm() { isStop = true; if (mutexRelease == 1) { ReleaseProtocolTracing(); CSAMRunning = false; } try { if (PingThread != null) { PingThread.Abort(); } } catch { } foreach (Thread td in pingList) { try { if (td != null) { td.Abort(); } } catch { } } foreach (Device dev in DeviceManger.deviceList) { if (dev.SendRexAnt) { dev.SendRexAnt = false; } } SaveData(); CSAMForm.Close(); CSAMForm.Dispose(true); }
public void End() { PingThread.Abort(); SocketHelper.EndConnection(); Program.LoginForm.Close(); }