public override void ChannelInactive(IChannelHandlerContext context) { if (protoBufSocket != null) { context.Channel.DisconnectAsync(); Console.WriteLine("=================Channel Inactive"); protoBufSocket.Connect(); } }
static void Main(string[] args) { var t = new ProtoBufSocket(); t.ReceiveMessage += ReceiveMessage; t.Connect(); t.SendMessage(BuildObject()); string cmd; do { cmd = Console.ReadLine(); if (cmd == "A") { t.SendMessage(BuildObject("A")); } } while (cmd != null && cmd.ToLower() != "q"); t.Disconnect(); }