public void Excute(ISessionHost host) { Console.WriteLine($"等待手动关闭程序。。。。"); var waitor = new AutoResetEvent(false); waitor.WaitOne(); }
public void Excute(ISessionHost host) { var port = SocketPort.GetNextTCPPort(); var tcpServer = new SocketListener(); tcpServer.ErrorEvent += TcpServer_ErrorEvent; tcpServer.MessageReceivedEvent += TcpServer_MessageReceivedEvent; tcpServer.StartListener(IPAddress.Parse("127.0.0.1"), port); }
public bool HandleException(ISessionHost host, Exception e) { if (e is SocketException || e is NetworkInformationException) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Net Ex:{e}"); Console.ResetColor(); return(true); } return(false); }
//TerminalSessionの開始 public void InternalStart(ISessionHost host) { _sessionHost = host; host.RegisterDocument(_terminal.IDocument); _output.Connection.Socket.RepeatAsyncRead(_terminal); }
public static ISessionHost Use <T>(this ISessionHost host) where T : ISessionTask { host.Use <T>(); return(host); }
public void InternalStart(ISessionHost host) { _host = host; _host.RegisterDocument(_document); }
public void InternalStart(ISessionHost host) { _host = host; _host.RegisterDocument(_document); }
//TerminalSessionの開始 public void InternalStart(ISessionHost host) { _sessionHost = host; host.RegisterDocument(_terminal.IDocument); _output.Connection.Socket.RepeatAsyncRead(_terminal); }
public void Excute(ISessionHost host) { Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine($"程序已启动"); Console.ResetColor(); }