示例#1
0
        public override void Test()
        {
            Api.Requests.Ping ping;

            Clear();

            WriteLine("Starting Ping test...");

            ping = new Api.Requests.Ping();

            _client = new ClientLib.Client();

            _start = DateTime.Now;
            _client.Execute(new Api.Requests.Ping(),
                            new ClientLib.ClientArgs()
            {
                Uri               = new Uri("http://" + FrmMain.HOST + ":" + FrmMain.PORT.ToString() + "/_ping"),
                ContentType       = "application/json",
                OnDisconnect      = OnDisconnect,
                OnComplete        = OnComplete,
                OnError           = OnError,
                OnProgress        = OnProgress,
                OnTimeout         = OnTimeout,
                SendTimeout       = FrmMain.SendTimeout,
                ReceiveTimeout    = FrmMain.ReceiveTimeout,
                SendBufferSize    = FrmMain.SendBufferSize,
                ReceiveBufferSize = FrmMain.ReceiveBufferSize,
            }
                            );
        }
示例#2
0
        public override void Test()
        {
            Api.Requests.Ping ping;
            
            Clear();

            WriteLine("Starting Ping test...");

            ping = new Api.Requests.Ping();

            _client = new ClientLib.Client();

            _start = DateTime.Now;
            _client.Execute(new Api.Requests.Ping(),
                new ClientLib.ClientArgs()
                {
                    Uri = new Uri("http://" + FrmMain.HOST + ":" + FrmMain.PORT.ToString() + "/_ping"),
                    ContentType = "application/json",
                    OnDisconnect = OnDisconnect,
                    OnComplete = OnComplete,
                    OnError = OnError,
                    OnProgress = OnProgress,
                    OnTimeout = OnTimeout,
                    SendTimeout = FrmMain.SendTimeout,
                    ReceiveTimeout = FrmMain.ReceiveTimeout,
                    SendBufferSize = FrmMain.SendBufferSize,
                    ReceiveBufferSize = FrmMain.ReceiveBufferSize,
                }
            );
        }
示例#3
0
        void OnComplete(ClientLib.Client sender, Http.HttpConnection connection, Http.Response httpResponse, Api.Responses.ResponseBase apiResponse, TimeSpan duration)
        {
            Api.Responses.Pong resp = (Api.Responses.Pong)apiResponse;

            WriteLine("Server execution time: " + resp.Duration.Milliseconds.ToString() + "ms.");
            WriteLine("Round-trip completed in " + (DateTime.Now - _start).Milliseconds.ToString() + "ms.");
            WriteLine("JSON response:\r\n" + resp.FullContent.ToString());
        }
 public Authenticate(FrmMain window, ClientLib.Client client)
     : base(window, client)
 {
 }
示例#5
0
 void OnDisconnect(ClientLib.Client sender, Http.HttpConnection connection, TimeSpan duration)
 {
     WriteLine("Connection closed.");
 }
示例#6
0
 void OnError(ClientLib.Client sender, Http.HttpConnection connection, string message, Exception exception, TimeSpan duration)
 {
     WriteLine("Error - Message: " + message);
 }
示例#7
0
 void OnProgress(ClientLib.Client sender, Http.HttpConnection connection, Tcp.DirectionType direction, int packetSize, TimeSpan duration, decimal requestPercentSent, decimal responsePercentComplete)
 {
     WriteLine("Progress - Sent: " + requestPercentSent.ToString() + " Received: " + responsePercentComplete.ToString());
 }
示例#8
0
 void OnTimeout(ClientLib.Client sender, Http.HttpConnection connection, TimeSpan duration)
 {
     WriteLine("Timeout occurred.");
 }
示例#9
0
 public Ping(FrmMain window, ClientLib.Client client)
     : base(window, client)
 {
 }
示例#10
0
 public TestBase(FrmMain window, ClientLib.Client client)
 {
     _window = window;
     _client = client;
 }
示例#11
0
 public TestBase(FrmMain window, ClientLib.Client client)
 {
     _window = window;
     _client = client;
 }