public override void Disconnect() { Console.WriteLine("Disconnecting..."); InnerThread.Abort(); ObjSocket.Shutdown(SocketShutdown.Both); ObjSocket.Close(); }
public override void StopWork() { ShouldStop = true; if (IsWaiting) { InnerThread.Abort(); } }
public override void StartWork() { if (InnerThread.ThreadState != ThreadState.Running) { IsWaiting = true; InnerThread.Start(); } }
protected override void Start() { var currState = ExecutionState; if (currState > NotStartedState) { ThrowHelper.ThrowInvalidOperationException_ExecutionState(currState); } InnerThread.Start(this); }
protected internal virtual void Start() { InnerThread.Start(); while (!_isStarted) { try { Thread.Sleep(1); } catch (ThreadInterruptedException) { _logger.Info("thread {0} interrupted when starting", InnerThread.ManagedThreadId); InnerThread.Interrupt(); break; } } }
public void Stop() { InnerThread.Abort(); }
public void Start() { InnerThread.Start(); }
#pragma warning restore CS1591 // 缺少对公共可见类型或成员的 XML 注释 private void Set(ThreadArgs arg, InnerThread th) { arg.Recyle(); ThreadCache.Set(th); Interlocked.Decrement(ref ThreadCount); }