소스 검색

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

Kenric Nugteren 1 년 전
부모
커밋
abbf220a52
3개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 2
      InABox.Client.RPC/RPCClient.cs
  2. 1 1
      InABox.Client.RPC/Transports/Pipe/RPCClientPipeTransport.cs
  3. 2 4
      InABox.Core/Client/Client.cs

+ 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)
             {