public override void ExceptionCaught(IChannelHandlerContext context, Exception exception) { Console.WriteLine("Exception: " + exception); context.CloseAsync(); SocketClientHandler.OutputException(exception); SocketClientHandler.ShutDown(1); }
static async Task Main(string[] args) { XmlConfigurator.Configure(); if (args.Length == 0) { throw new ArgumentException("Usage: reactiveclient host build"); } var host = args[0]; var port = 1055; var build = args[1]; var image = args[2]; var yamlFileLocation = args[3]; string yaml = File.ReadAllText(yamlFileLocation); BuildRunRequest request = new BuildRunRequest { Build = build, Yaml = yaml }; try { SocketClientHandler.OutputMessage("Starting wait"); await RunClientAsync(request).ConfigureAwait(true); for (int i = 0; i < 1000; i++) { Thread.Sleep(1000); } } catch (Exception e) { SocketClientHandler.OutputException(e); SocketClientHandler.ShutDown(1); } SocketClientHandler.OutputMessage("Before Readline"); Console.ReadLine(); SocketClientHandler.OutputMessage("Exiting"); }