コード例 #1
0
ファイル: Binding.cs プロジェクト: hallambaker/Omnibroker
 public virtual QResponse RequestResponse(QRequest RequestIn)
 {
     Request (RequestIn);
     return Response ();
 }
コード例 #2
0
ファイル: Binding.cs プロジェクト: hallambaker/Omnibroker
 public override void Request(QRequest Request)
 {
     BoundRequest BoundRequest = new BoundRequest (Request.ToString (), Cryptographic);
     Messages.Add (BoundRequest);
     Console.WriteLine (BoundRequest.HTTPBinding);
     PendingResponse =  QueryServer.Request (BoundRequest);
     Messages.Add (PendingResponse);
 }
コード例 #3
0
ファイル: Binding.cs プロジェクト: hallambaker/Omnibroker
 public abstract void Request(QRequest Request);
コード例 #4
0
ファイル: Query.cs プロジェクト: hallambaker/Omnibroker
        public static void Deserialize(string _Input, out QRequest Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

            JSONReader.StartObject ();
            string token = JSONReader.ReadToken ();
            Out = null;

            switch (token) {

                case "QRequest" : {
                    Out = null;
                    throw new Exception ("Can't create abstract type");
                    }

                case "QueryConnectRequest" : {
                    QueryConnectRequest Result = new QueryConnectRequest ();
                    Result.Deserialize (JSONReader);
                    Out = Result;
                    break;
                    }

                case "AdvertiseRequest" : {
                    AdvertiseRequest Result = new AdvertiseRequest ();
                    Result.Deserialize (JSONReader);
                    Out = Result;
                    break;
                    }

                case "ValidateRequest" : {
                    ValidateRequest Result = new ValidateRequest ();
                    Result.Deserialize (JSONReader);
                    Out = Result;
                    break;
                    }

                case "CredentialPasswordRequest" : {
                    CredentialPasswordRequest Result = new CredentialPasswordRequest ();
                    Result.Deserialize (JSONReader);
                    Out = Result;
                    break;
                    }

                default : {
                    throw new Exception ("Not supported");
                    }
                }
            JSONReader.EndObject ();

            // should we check for EOF here?
        }