Exemple #1
0
        public static void Deserialize(string _Input, out Request Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

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

            switch (token) {

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

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

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

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

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

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

            // should we check for EOF here?
        }
Exemple #2
0
 public virtual Response RequestResponse(Request RequestIn)
 {
     Request (RequestIn);
     return Response ();
 }
Exemple #3
0
 public override void Request(Request Request)
 {
 }
Exemple #4
0
 public abstract void Request(Request Request);
Exemple #5
0
 public override void Request(Request Request)
 {
     BoundRequest BoundRequest = new BoundRequest (Request.ToString (), Cryptographic);
     Messages.Add (BoundRequest);
     Console.WriteLine (BoundRequest.HTTPBinding);
     PendingResponse = ConnectionServer.Request (BoundRequest);
     Messages.Add (PendingResponse);
 }