Example #1
0
        public virtual ServiceEntry CreateServiceEntry(SlpReader reader)
        {
            if (reader.ReadByte() != 0)
                throw new ServiceProtocolException(ServiceErrorCode.ParseError);

            var result = new ServiceEntry();
            result.Lifetime = reader.ReadTimeSpan();
            result.Uri = new ServiceUri(reader.ReadString());

            var count = reader.ReadByte();
            for (int i = 0; i < count; i++)
            {
                var a = CreateAuthenticationBlock(reader);
                result.AuthBlocks.Add(a);
                ServiceEntry.OnAuthenticated(result, a);
            }

            return result;
        }
Example #2
0
        public virtual ServiceEntry CreateServiceEntry(SlpReader reader)
        {
            if (reader.ReadByte() != 0)
            {
                throw new ServiceProtocolException(ServiceErrorCode.ParseError);
            }

            var result = new ServiceEntry();

            result.Lifetime = reader.ReadTimeSpan();
            result.Uri      = new ServiceUri(reader.ReadString());

            var count = reader.ReadByte();

            for (int i = 0; i < count; i++)
            {
                var a = CreateAuthenticationBlock(reader);
                result.AuthBlocks.Add(a);
                ServiceEntry.OnAuthenticated(result, a);
            }

            return(result);
        }