예제 #1
0
 public static void ParseStreamStatus(SamReply reply)
 {
     if (reply == null)
     {
         throw new ArgumentNullException("reply");
     }
     if (!reply.Check("STREAM", "STATUS"))
     {
         throw new SamReplyMismatchException(reply);
     }
     if (reply.ResultString != SamBridgeErrorMessage.OK)
     {
         throw new SamBridgeErrorException(reply);
     }
 }
예제 #2
0
        public static string ParseSessionStatus(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("SESSION", "STATUS"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string destination = reply.UniqueValue("DESTINATION").Value;

            return(destination);
        }
예제 #3
0
        public static string ParseHelloReply(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("HELLO", "REPLY"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string version = reply.UniqueValue("VERSION").Value;

            return(version);
        }
예제 #4
0
        public static SamDestination ParseDestReply(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("DEST", "REPLY"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string pubBase64  = reply.UniqueValue("PUB").Value;
            string privBase64 = reply.UniqueValue("PRIV").Value;

            return(new SamDestination(pubBase64, privBase64));
        }
예제 #5
0
        public static SamLookupResult ParseNamingReply(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("NAMING", "REPLY"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string nameInReply = reply.UniqueValue("NAME").Value;
            string valueBase64 = reply.UniqueValue("VALUE").Value;

            return(new SamLookupResult(nameInReply, valueBase64));
        }
예제 #6
0
        public static SamReply ParseReply(string input, string major, string minor)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            if (major == null)
            {
                throw new ArgumentNullException("major");
            }
            if (minor == null)
            {
                throw new ArgumentNullException("minor");
            }

            SamReply reply = Parse(input);

            if (!reply.Check(major, minor))
            {
                throw new SamReplyMismatchException(reply);
            }
            return(reply);
        }
예제 #7
0
 public static void ParseStreamStatus(SamReply reply)
 {
     if (reply == null)
         throw new ArgumentNullException("reply");
     if (!reply.Check("STREAM", "STATUS"))
         throw new SamReplyMismatchException(reply);
     if (reply.ResultString != SamBridgeErrorMessage.OK)
         throw new SamBridgeErrorException(reply);
 }
예제 #8
0
        public static string ParseSessionStatus(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("SESSION", "STATUS"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string destination = reply.UniqueValue("DESTINATION").Value;
            return destination;
        }
예제 #9
0
        public static SamLookupResult ParseNamingReply(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("NAMING", "REPLY"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string nameInReply = reply.UniqueValue("NAME").Value;
            string valueBase64 = reply.UniqueValue("VALUE").Value;
            return new SamLookupResult(nameInReply, valueBase64);
        }
예제 #10
0
        public static string ParseHelloReply(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("HELLO", "REPLY"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string version = reply.UniqueValue("VERSION").Value;
            return version;
        }
예제 #11
0
        public static SamDestination ParseDestReply(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("DEST", "REPLY"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string pubBase64 = reply.UniqueValue("PUB").Value;
            string privBase64 = reply.UniqueValue("PRIV").Value;
            return new SamDestination(pubBase64, privBase64);
        }