Exemplo n.º 1
0
        private void OnEncode(ISession session, object data, System.IO.Stream stream)
        {
            PipeStream pstream = stream.ToPipeStream();
            DataFrame  dp      = data as DataFrame;

            if (dp != null)
            {
                dp.Write(pstream);
            }
            else
            {
                HttpResponse response = (HttpResponse)data;
                response.Write(pstream);
            }
        }
Exemplo n.º 2
0
        private void OnEncode(ISession session, object data, System.IO.Stream stream)
        {
            PipeStream pstream = stream.ToPipeStream();

            StaticResurce.FileBlock fb = data as StaticResurce.FileBlock;
            if (fb != null)
            {
                fb.Write(pstream);
            }
            else
            {
                WebSockets.DataFrame dataPacket = data as WebSockets.DataFrame;
                if (dataPacket != null)
                {
                    dataPacket.Write(pstream);
                }
                else
                {
                    HttpResponse response = (HttpResponse)data;
                    response.Write(pstream);
                }
            }
        }