Jelajahi Sumber

Fix to proxy server connection bug

Kenric Nugteren 1 tahun lalu
induk
melakukan
e9c896b63f

+ 0 - 5
InABox.Core/DigitalForms/Forms/DigitalForm.cs

@@ -104,11 +104,6 @@ namespace InABox.Core
             var result = new EntityDuplicator<DigitalForm>();
             result.AddChild<DigitalForm, DigitalFormVariable, DigitalFormLink>(x => x.Form);
             result.AddChild<DigitalForm, DigitalFormLayout, DigitalFormLink>(x => x.Form);
-<<<<<<< HEAD
-            result.AddChild<DigitalForm, DigitalFormDocument, DigitalFormLink>(x => x.EntityLink);
-            result.AddChild<DigitalForm, ReportTemplate>(new Column<ReportTemplate>(x => x.Section), x => x.ID.ToString());
-=======
->>>>>>> kenric
             return result;
         }
 

+ 1 - 0
InABox.Server/InnerServer/InternalServer.cs

@@ -132,6 +132,7 @@ public class InternalServer : IPusher, IRpcServer
                 ID = sessionID,
                 Connection = connection
             };
+            _sessions.TryAdd(sessionID, session);
         }
         return session;
     }

+ 8 - 2
InABox.Server/RPC/ProxyServers/RPCProxyServer.cs

@@ -116,7 +116,7 @@ public abstract class RpcProxyServer<TConnection> : IRpcProxyServer where TConne
             var result = SendToServer<OpenSessionCommand, OpenSessionParameters, OpenSessionResult>(Guid.Empty, new OpenSessionParameters());
             CreateSession(connection, result.SessionID);
 
-            if (result.SessionID  != Guid.Empty)
+            if (result.SessionID != Guid.Empty)
                 OnLog?.Invoke(LogType.Information, "", $"Client Connected [{result.SessionID}]");
         }
         catch(Exception e)
@@ -138,7 +138,7 @@ public abstract class RpcProxyServer<TConnection> : IRpcProxyServer where TConne
                 });
             }
             if (session  != Guid.Empty)
-                OnLog?.Invoke(LogType.Information, "", $"Client Disonnected [{session}]");
+                OnLog?.Invoke(LogType.Information, "", $"Client Disconnected [{session}]");
         }
         catch(Exception e)
         {
@@ -150,7 +150,13 @@ public abstract class RpcProxyServer<TConnection> : IRpcProxyServer where TConne
     {
         var session = GetSession(connection);
         if (session != Guid.Empty)
+        {
             OnLog?.Invoke(LogType.Error, $"", $"Exception Occurred in {session}: {e.Message}");
+        }
+        else
+        {
+            OnLog?.Invoke(LogType.Error, $"", $"Exception Occurred: {CoreUtils.FormatException(e)}");
+        }
     }
 
     /// <summary>