Exemple #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");
 }
Exemple #2
0
        public NamedPipeServerConnection(
            NamedPipeConnectionEndPoint connectionEndPoint)
            : base(false, connectionEndPoint?.ConnectionSettings ?? new ServerConnectionSettings(keepAliveMilliseconds: 0 /*by default named pipe does't require keep alive messages*/))
        {
            if (_connectionSettings.UseBufferedStream)
            {
                throw new NotSupportedException();
            }

            _serverConnectionSettings = (ServerConnectionSettings)_connectionSettings;
            _localEndPointName        = connectionEndPoint.LocalEndPointName ?? throw new ArgumentNullException("connectionEndPoint.LocalEndPointName");
        }
 public static IConnection CreateServer(string localNamedPipeName, ServerConnectionSettings connectionSettings = null)
 => CreateServer(new NamedPipeConnectionEndPoint(localNamedPipeName: localNamedPipeName, connectionSettings: connectionSettings));
Exemple #4
0
 public static IConnection CreateRedundantServer(IPAddress[] localAddresses, int localPort, ServerConnectionSettings connectionSettings = null)
 => ServiceRef.Create <IConnection>(new RedundantConnection(localAddresses.Select(localAddress => CreateServer(localAddress, localPort, connectionSettings: connectionSettings)).ToArray()));
Exemple #5
0
 public static IConnection CreateRedundantServer(IPEndPoint[] localEndPoints, ServerConnectionSettings connectionSettings = null)
 => ServiceRef.Create <IConnection>(new RedundantConnection(localEndPoints.Select(ipEndpoint => CreateServer(ipEndpoint, connectionSettings)).ToArray()));
Exemple #6
0
 public static IConnection CreateServer(IPAddress localIp, int localPort, ServerConnectionSettings connectionSettings = null)
 => CreateServer(new IPEndPoint(localIp, localPort), connectionSettings);
Exemple #7
0
 public static IConnection CreateServer(IPEndPoint localEndPoint, ServerConnectionSettings connectionSettings = null)
 => CreateServer(new TcpConnectionEndPoint(localEndPoint: localEndPoint, connectionSettings: connectionSettings));