protected void OnNormalTerminationCore() { if (_normalTerminationCalled) { return; } /* NOTE * 正常終了の場合でも、SSHパケットレベルではChannelEOF, ChannelClose, ConnectionCloseがあり、場合によっては複数個が組み合わされることもある。 * 組み合わせの詳細はサーバの実装依存でもあるので、ここでは1回だけ必ず呼ぶということにする。 */ _normalTerminationCalled = true; _parent.CloseBySocket(); try { if (_callback != null) { _callback.OnNormalTermination(); } } catch (Exception ex) { CloseError(ex); } finally { if (NormalTermination != null) { NormalTermination(this, null); } } }
public void OnNormalTermination() { if (NormalTermination != null) { NormalTermination.Invoke(this, null); } _callback.OnNormalTermination(); }
private GenericResult OnNormalTerminationCore() { try { _ownerConnection.CloseBySocket(); _callback.OnNormalTermination(); return(GenericResult.Succeeded); } catch (Exception ex) { RuntimeUtil.ReportException(ex); _socket.Disconnect(false); return(GenericResult.Failed); } }
/// <summary> /// Thread input from stream /// </summary> /// <param name="asyncInput"></param> private void InputThread(IByteAsyncInputStream asyncInput) { byte[] buff = new byte[4096]; ByteDataFragment _dataFragment = new ByteDataFragment(); try { bool endOfStream = false; while (!_terminateInputThread && !_processExited) { IAsyncResult asyncResult = _inputStream.BeginRead(buff, 0, buff.Length, null, null); while (!_terminateInputThread && !_processExited) { bool signaled = asyncResult.AsyncWaitHandle.WaitOne(500); if (signaled) { int len = _inputStream.EndRead(asyncResult); if (len == 0) { endOfStream = true; goto EndThread; } _dataFragment.Set(buff, 0, len); asyncInput.OnReception(_dataFragment); break; } } } EndThread: if (endOfStream || _processExited) { _skipInputThreadJoin = true; // avoids deadlock Close(); asyncInput.OnNormalTermination(); } } catch (Exception e) { RuntimeUtil.SilentReportException(e); _skipInputThreadJoin = true; // avoids deadlock Close(); asyncInput.OnAbnormalTermination("Input thread error: " + e.Message); } }
protected void OnNormalTerminationCore() { if (_normalTerminationCalled) { return; } /* NOTE * ³íI—¹‚ÌꇂłàASSHƒpƒPƒbƒgƒŒƒxƒ‹‚Å‚ÍChannelEOF, ChannelClose, ConnectionClose‚ª‚ ‚èAꇂɂæ‚Á‚Ä‚Í•¡”ŒÂ‚ª‘g‚݇‚킳‚ê‚邱‚Æ‚à‚ ‚éB * ‘g‚݇‚킹‚ÌÚׂ̓T[ƒo‚ÌŽÀ‘•ˆË‘¶‚Å‚à‚ ‚é‚Ì‚ÅA‚±‚±‚Å‚Í‚P‰ñ‚¾‚¯•K‚¸ŒÄ‚Ô‚Æ‚¢‚¤‚±‚Æ‚É‚·‚éB */ _normalTerminationCalled = true; EnsureCallbackHandler(); _parent.CloseBySocket(); try { _callback.OnNormalTermination(); } catch (Exception ex) { CloseError(ex); } }
public void OnNormalTermination() { _site.Cancel(null); Dispose(); _defaultHandler.OnNormalTermination(); }
public void OnNormalTermination() { _callback.OnNormalTermination(); }