Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
seveneleven committed May 24, 2024
2 parents 3784c9f + 5844846 commit 4209624
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<Import Project=".build\Common.props" Condition="'$(CreatePackage)' == 'true'" />
<Import Project=".build\Common.props" Condition="'$(IsPackable)' == 'true'" />

<PropertyGroup>
<dotnetVersion>8.0.0</dotnetVersion>
Expand All @@ -10,8 +10,8 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>

<!-- Package refereces for all projects if CreatePackage=true -->
<ItemGroup Condition="'$(CreatePackage)' == 'true'">
<!-- Package refereces for all projects if IsPackable=true -->
<ItemGroup Condition="'$(IsPackable)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.3
8.0.4
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ export default class ClassEditor extends CollapsibleEntryEditorBase<ClassEditorS
return (
<div>
<Collapse in={this.props.IsExpanded}>
<Container style={{paddingRight: "0"}}>
{this.preRenderConfigEditor()}
</Container>
{
this.props.IsExpanded &&
<Container style={{paddingRight: "0"}}>
{this.preRenderConfigEditor()}
</Container>
}
</Collapse>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class CollectionEditor extends CollapsibleEntryEditorBase<Collect
return (
<Collapse in={this.props.IsExpanded}>
<Grid container={true} item={true} sx={{paddingLeft: 3, paddingRight: 0}}>
{
{ this.props.IsExpanded &&
this.props.Entry.subEntries.map((entry, idx) => {
if (Entry.isClassOrCollection(entry)) {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/Moryx/Communication/Sockets/Client/TcpClientConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;

Expand Down
20 changes: 16 additions & 4 deletions src/Moryx/Communication/Sockets/TcpTransmission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal class TcpTransmission : IBinaryTransmission, IDisposable
/// <summary>
/// Callback to forward transmission exceptions to connection
/// </summary>
public event EventHandler<Exception> ExceptionOccured;
public event EventHandler<Exception> ExceptionOccurred;

/// <summary>
/// Initialize TcpTransmission
Expand All @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 4209624

Please sign in to comment.