Beispiel #1
0
        private TcpChannel(TcpEndpointData endpointData,
                           IMessageSerializer serializer,
                           ChannelSettings channelSettings,
                           TcpConnectionSettings connetcionSettings)
            : this(endpointData, serializer)
        {
            connetcionSettings.SetupClient(_client);

            MaxMessageLength = channelSettings.MaxMessageLength;
        }
Beispiel #2
0
        internal TcpChannel(TcpClient client,
                            IMessageSerializer serializer,
                            ChannelSettings channelSettings,
                            TcpConnectionSettings connetcionSettings,
                            ISecurityWrapper serverSecurityWrapper)
        {
            Enforce.NotNull(client, nameof(client));
            Enforce.NotNull(serializer, nameof(serializer));

            var ipEndPoint = (IPEndPoint)client.Client.RemoteEndPoint;

            _endpointData   = new TcpEndpointData(ipEndPoint.Address, ipEndPoint.Port);
            Serializer      = serializer;
            _client         = client;
            _client.NoDelay = true;

            connetcionSettings.SetupClient(_client);
            MaxMessageLength = channelSettings.MaxMessageLength;

            SecurityWrapper = serverSecurityWrapper;

            ResponseHandshake();
        }