private void StartNextUnit() { if (!Core.NetworkAP.IsOwnerThread) { StartNextUnitAsync(); } else { if (_unitQueue.Count > 0) { AsciiProtocolUnit unit = (AsciiProtocolUnit)_unitQueue.Pop(); unit.Finished += new AsciiProtocolUnitDelegate(unit_Finished); _currentUnit = unit; if (LastSocketException == null) { unit.Start(this); } else { Close(); } } } }
protected static void StartUnit(AsciiProtocolUnit unit, AsciiTcpConnection connection) { unit.Start(connection); }