예제 #1
0
 public override StringRequestInfo ResolvePackage(IList <ArraySegment <byte> > packageData)
 {
     using (var reader = this.GetBufferReader(packageData))
     {
         var requestInfo = m_Parser.Parse(reader.Skip(1).ReadString((int)reader.Length - 2, Encoding.ASCII));
         NextReceiveFilter = m_SwitchFilter;
         return(requestInfo);
     }
 }
            public override StringRequestInfo ResolvePackage(IList <ArraySegment <byte> > packageData)
            {
                var length = packageData.Sum(x => x.Count);

                if (length < 20)
                {
                    Console.WriteLine("Ignore request");
                    return(null);
                }

                var line = Encoding.ASCII.GetString(packageData);

                return(m_Parser.Parse(line.Substring(2, line.Length - 4)));
            }
 public override StringRequestInfo ResolvePackage(IList <ArraySegment <byte> > packageData)
 {
     return(m_Parser.Parse(Encoding.ASCII.GetString(packageData)));
 }