Skip to content

Commit

Permalink
beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
mregen committed May 12, 2024
1 parent 29659e1 commit 9c3ed0f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 5 additions & 1 deletion Stack/Opc.Ua.Core/Stack/Tcp/TcpMessageType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@ public static class TcpMessageLimits
/// The default maximum message size.
/// </summary>
/// <remarks>
/// The default is 2MB. Ensure to set this to a value aligned to <see cref="MinBufferSize"/>.
/// This default is for the Tcp transport. <see cref="DefaultEncodingLimits.MaxMessageSize"/> for the generic default.
/// </remarks>
public const int DefaultMaxMessageSize = 0x10000 * 16;
public const int DefaultMaxMessageSize = MinBufferSize * 256;

/// <summary>
/// The default maximum message size for the discovery channel.
Expand Down Expand Up @@ -305,6 +306,9 @@ public static class TcpMessageLimits
/// <summary>
/// Aligns the max message size to the nearest min buffer size.
/// </summary>
/// <remarks>
/// Align user configured maximum message size to avoid rounding errors in other UA implementations.
/// </remarks>
public static int AlignRoundMaxMessageSize(int value)
{
int alignmentMask = MinBufferSize - 1;
Expand Down
18 changes: 11 additions & 7 deletions Stack/Opc.Ua.Core/Types/Utils/DefaultEncodingLimits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

using System;
using Opc.Ua.Bindings;

namespace Opc.Ua
{
Expand All @@ -21,32 +22,35 @@ namespace Opc.Ua
public static class DefaultEncodingLimits
{
/// <summary>
/// The maximum length for any string, byte string or xml element.
/// The default maximum length for any string, byte string or xml element.
/// </summary>
public static readonly int MaxStringLength = UInt16.MaxValue;

/// <summary>
/// The maximum length for any array.
/// The default maximum length for any array.
/// </summary>
public static readonly int MaxArrayLength = UInt16.MaxValue;

/// <summary>
/// The maximum length for any ByteString.
/// The default maximum length for any ByteString.
/// </summary>
public static readonly int MaxByteStringLength = UInt16.MaxValue * 16;

/// <summary>
/// The maximum length for any Message.
/// The default maximum length for any Message.
/// </summary>
public static readonly int MaxMessageSize = 0x10000 * 16;
/// <remarks>
/// Default is 2MB. Set to multiple of MinBufferSize to avoid rounding errors in other UA implementations.
/// </remarks>
public static readonly int MaxMessageSize = TcpMessageLimits.MinBufferSize * 256;

/// <summary>
/// The maximum nesting level accepted while encoding or decoding objects.
/// The default maximum nesting level accepted while encoding or decoding objects.
/// </summary>
public static readonly int MaxEncodingNestingLevels = 200;

/// <summary>
/// The number of times the decoder can recover from an error
/// The default number of times the decoder can recover from an error
/// caused by an encoded ExtensionObject before throwing a decoder error.
/// </summary>
public static readonly int MaxDecoderRecoveries = 0;
Expand Down

0 comments on commit 9c3ed0f

Please sign in to comment.