瀏覽代碼

Merge remote-tracking branch 'origin/frank' into kenric

Kenric Nugteren 11 月之前
父節點
當前提交
abbf220a52

+ 6 - 2
InABox.Client.RPC/RPCClient.cs

@@ -225,8 +225,12 @@ namespace InABox.Rpc
             {
                 if (!_transport.IsConnected())
                     _transport.Connect();
-                _transport.Send<RpcPingCommand, RpcPingParameters, RpcPingResult>(new RpcPingParameters());
-                return true;
+                if (_transport.IsConnected())
+                {
+                    _transport.Send<RpcPingCommand, RpcPingParameters, RpcPingResult>(new RpcPingParameters());
+                    return true;
+                }
+                return false;
             }
             catch (Exception)
             {

+ 1 - 1
InABox.Client.RPC/Transports/Pipe/RPCClientPipeTransport.cs

@@ -23,7 +23,7 @@ namespace InABox.Rpc
 
         public override bool Connect(CancellationToken ct = default)
         {
-            _pipe.ConnectAsync(ct).Wait();
+            _pipe.ConnectAsync(ct).Wait(10000, ct);
             return _pipe.IsConnected;
         }
 

+ 2 - 4
InABox.Core/Client/Client.cs

@@ -48,8 +48,7 @@ namespace InABox.Clients
 
         private static IClient CheckClient()
         {
-            using (new Profiler(true))
-                return ClientFactory.CreateClient<User>();
+            return ClientFactory.CreateClient<User>();
         }
 
         public static Dictionary<string, CoreTable> QueryMultiple(Dictionary<string, IQueryDef> queries)
@@ -271,8 +270,7 @@ namespace InABox.Clients
         {
             try
             {
-                using (new Profiler(true))
-                    return CheckClient().Ping();
+                return CheckClient().Ping();
             }
             catch (RequestException e)
             {