Files
DotNetty/examples/Telnet.Client/TelnetClientHandler.cs
egmkang wang a9850b4775 sample:discard,factorial,securechat,telnet (#142)
Squashed commit:

[7fbc42e] comment about BigInteger.ToByteArray()

[3be0644] delete ChannelInboundHander and ChannelInboudnHandlerAdpter

[b07f8d9] fix Microsoft.Practices compile error, use echo proj's version

[c19a551] sample:discard,factorial,securechat,telnet
2016-07-25 10:17:54 -07:00

23 lines
723 B
C#

// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Telnet.Client
{
using System;
using DotNetty.Transport.Channels;
public class TelnetClientHandler : SimpleChannelInboundHandler<string>
{
protected override void ChannelRead0(IChannelHandlerContext contex, string msg)
{
Console.WriteLine(msg);
}
public override void ExceptionCaught(IChannelHandlerContext contex, Exception e)
{
Console.WriteLine(DateTime.Now.Millisecond);
Console.WriteLine("{0}", e.StackTrace);
contex.CloseAsync();
}
}
}