Example #1
0
 public TcpServerConnection(
     TcpConnectionEndPoint connectionEndPoint)
     : base((connectionEndPoint?.ConnectionSettings?.EnableMessageFraming).GetValueOrDefault(true),
            connectionEndPoint?.ConnectionSettings ?? new ServerConnectionSettings())
 {
     _serverConnectionSettings = (ServerConnectionSettings)_connectionSettings;
     _localEndPoint            = connectionEndPoint.LocalEndPoint ?? throw new ArgumentNullException("connectionEndPoint.LocalEndPoint");
 }
 public TcpClientConnection(
     TcpConnectionEndPoint connectionEndPoint)
     : base((connectionEndPoint?.ConnectionSettings?.EnableMessageFraming).GetValueOrDefault(true),
            connectionEndPoint?.ConnectionSettings ?? new ClientConnectionSettings())
 {
     _clientConnectionSettings = (ClientConnectionSettings)_connectionSettings;
     _remoteEndPoint           = connectionEndPoint.RemoteEndPoint ?? throw new ArgumentNullException(nameof(connectionEndPoint.RemoteEndPoint));
     _localEndPoint            = connectionEndPoint.LocalEndPoint;
 }
Example #3
0
 private static IConnection CreateSslServer(TcpConnectionEndPoint endPoint)
 => ServiceRef.Create <IConnection>(new SslTcpServerConnection(endPoint));
Example #4
0
 private static IConnection CreateSslClient(TcpConnectionEndPoint endPoint)
 => ServiceRef.Create <IConnection>(new SslTcpClientConnection(endPoint));
Example #5
0
 private static IConnection CreateServer(TcpConnectionEndPoint connectionEndPoint)
 => ServiceRef.Create <IConnection>(new TcpServerConnection(connectionEndPoint));