コード例 #1
0
 public override void ChannelInactive(IChannelHandlerContext context)
 {
     if (protoBufSocket != null)
     {
         context.Channel.DisconnectAsync();
         Console.WriteLine("=================Channel Inactive");
         protoBufSocket.Connect();
     }
 }
コード例 #2
0
        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();
        }