diff --git a/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/ClassEditor.tsx b/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/ClassEditor.tsx index 2b0f48c2b..f74f3c8ef 100644 --- a/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/ClassEditor.tsx +++ b/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/ClassEditor.tsx @@ -30,9 +30,12 @@ export default class ClassEditor extends CollapsibleEntryEditorBase - - {this.preRenderConfigEditor()} - + { + this.props.IsExpanded && + + {this.preRenderConfigEditor()} + + } ); diff --git a/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/CollectionEditor.tsx b/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/CollectionEditor.tsx index afc410382..dc212eca4 100644 --- a/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/CollectionEditor.tsx +++ b/src/Moryx.CommandCenter.Web/src/modules/components/ConfigEditor/CollectionEditor.tsx @@ -128,7 +128,7 @@ export default class CollectionEditor extends CollapsibleEntryEditorBase - { + { this.props.IsExpanded && this.props.Entry.subEntries.map((entry, idx) => { if (Entry.isClassOrCollection(entry)) { return ( diff --git a/src/Moryx/Communication/Sockets/Client/TcpClientConnection.cs b/src/Moryx/Communication/Sockets/Client/TcpClientConnection.cs index 5bc2f5802..bd2726185 100644 --- a/src/Moryx/Communication/Sockets/Client/TcpClientConnection.cs +++ b/src/Moryx/Communication/Sockets/Client/TcpClientConnection.cs @@ -176,7 +176,7 @@ internal void Connected() { _transmission = new TcpTransmission(_tcpClient, _validator.Interpreter, Logger.GetChild(string.Empty, typeof(TcpTransmission))); _transmission.Disconnected += ConnectionClosed; - _transmission.ExceptionOccured += OnTransmissionException; + _transmission.ExceptionOccurred += OnTransmissionException; _transmission.Received += MessageReceived; _transmission.StartReading(); @@ -205,7 +205,7 @@ internal void Disconnect() // First close the connection and then unregister events transmission.Disconnect(); - transmission.ExceptionOccured -= OnTransmissionException; + transmission.ExceptionOccurred -= OnTransmissionException; transmission.Received -= MessageReceived; transmission.Disconnected -= ConnectionClosed; diff --git a/src/Moryx/Communication/Sockets/TcpTransmission.cs b/src/Moryx/Communication/Sockets/TcpTransmission.cs index 8a59633a8..935162f48 100644 --- a/src/Moryx/Communication/Sockets/TcpTransmission.cs +++ b/src/Moryx/Communication/Sockets/TcpTransmission.cs @@ -31,7 +31,7 @@ internal class TcpTransmission : IBinaryTransmission, IDisposable /// /// Callback to forward transmission exceptions to connection /// - public event EventHandler ExceptionOccured; + public event EventHandler ExceptionOccurred; /// /// Initialize TcpTransmission @@ -53,10 +53,10 @@ public TcpTransmission(TcpClient client, IMessageInterpreter interpreter, ILogge private void RaiseException(Exception ex) { - if (ExceptionOccured == null) + if (ExceptionOccurred == null) _logger.Log(LogLevel.Error, ex, "TcpTransmission encountered an error"); else - ExceptionOccured(this, ex); + ExceptionOccurred(this, ex); } private void RaiseDisconnected() @@ -81,7 +81,19 @@ public void ConfigureKeepAlive(int interval, int timeout) // Configure socket using net6 keep alive configuration socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, interval); socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, timeout); - socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 2); + + try + { + // Try to set the TcpKeeepAliveRetryCount, it is not supported on all windows systems + // https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options#windows-support-for-ipproto_tcp-options + socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 2); + + } + catch(Exception ex) + { + _logger.Log(LogLevel.Warning, ex, "TcpKeepAliveRetryCount could not be applied!"); + } + socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); #else // Keep alive only supported for windows under netstandard2.0