コード例 #1
0
        public void UaTcpTransportChannelOptionsDefaults()
        {
            var lowestBufferSize = 8192u;

            var options = new UaTcpTransportChannelOptions();

            options.LocalReceiveBufferSize
            .Should().BeGreaterOrEqualTo(lowestBufferSize);
            options.LocalSendBufferSize
            .Should().BeGreaterOrEqualTo(lowestBufferSize);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UaTcpTransportChannel"/> class.
 /// </summary>
 /// <param name="remoteEndpoint">The remote endpoint.</param>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="options">The transport channel options.</param>
 public UaTcpTransportChannel(
     EndpointDescription remoteEndpoint,
     ILoggerFactory loggerFactory         = null,
     UaTcpTransportChannelOptions options = null)
     : base(loggerFactory)
 {
     this.RemoteEndpoint         = remoteEndpoint ?? throw new ArgumentNullException(nameof(remoteEndpoint));
     this.logger                 = loggerFactory?.CreateLogger <UaTcpTransportChannel>();
     this.LocalReceiveBufferSize = options?.LocalReceiveBufferSize ?? DefaultBufferSize;
     this.LocalSendBufferSize    = options?.LocalSendBufferSize ?? DefaultBufferSize;
     this.LocalMaxMessageSize    = options?.LocalMaxMessageSize ?? DefaultMaxMessageSize;
     this.LocalMaxChunkCount     = options?.LocalMaxChunkCount ?? DefaultMaxChunkCount;
 }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UaTcpTransportChannel"/> class.
        /// </summary>
        /// <param name="remoteEndpoint">The remote endpoint.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="options">The transport channel options.</param>
        public UaTcpTransportChannel(
            EndpointDescription remoteEndpoint,
            ILoggerFactory loggerFactory         = null,
            UaTcpTransportChannelOptions options = null)
            : base(loggerFactory)
        {
            if (remoteEndpoint == null)
            {
                throw new ArgumentNullException(nameof(remoteEndpoint));
            }

            this.RemoteEndpoint = remoteEndpoint;
            this.options        = options ?? new UaTcpTransportChannelOptions();
            this.logger         = loggerFactory?.CreateLogger <UaTcpTransportChannel>();
        }