예제 #1
0
        public override void ChannelRead(IChannelHandlerContext context, object message)
        {
            AttributeKey <NiftyConnectionContext> key = AttributeKey <NiftyConnectionContext> .ValueOf(NiftyConnectionContextKey);

            NiftyConnectionContext nContext = context.GetAttribute <NiftyConnectionContext>(key).Get();

            base.ChannelRead(context, message);
        }
예제 #2
0
        public override void ChannelActive(IChannelHandlerContext context)
        {
            base.ChannelActive(context);
            NiftyConnectionContext ncontext = new NiftyConnectionContext();

            ncontext.RemoteAddress = context.Channel.RemoteAddress;
            AttributeKey <NiftyConnectionContext> key = AttributeKey <NiftyConnectionContext> .ValueOf(NiftyConnectionContextKey);

            context.GetAttribute <NiftyConnectionContext>(key).Set(ncontext);
        }