コード例 #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
ファイル: Ping.cs プロジェクト: 274706834/opendms-dot-net
        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());
        }
コード例 #4
0
 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
ファイル: TestBase.cs プロジェクト: 274706834/opendms-dot-net
 public TestBase(FrmMain window, ClientLib.Client client)
 {
     _window = window;
     _client = client;
 }
コード例 #11
0
 public TestBase(FrmMain window, ClientLib.Client client)
 {
     _window = window;
     _client = client;
 }