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 NamedPipeClientConnection( NamedPipeConnectionEndPoint connectionEndPoint) : base(false, connectionEndPoint?.ConnectionSettings ?? new ClientConnectionSettings(keepAliveMilliseconds: 0 /*by default named pipe does't require keep alive messages*/)) { if (_connectionSettings.UseBufferedStream) { throw new NotSupportedException(); } _clientConnectionSettings = (ClientConnectionSettings)_connectionSettings; _remoteNamedPipeName = connectionEndPoint.RemoteEndPointName ?? throw new ArgumentNullException(nameof(connectionEndPoint.RemoteEndPointName)); _remoteNamedPipeHost = connectionEndPoint.RemoteEndPointHost ?? throw new ArgumentNullException(nameof(connectionEndPoint.RemoteEndPointName)); }
private static IConnection CreateServer(NamedPipeConnectionEndPoint connectionEndPoint) => ServiceRef.Create <IConnection>(new NamedPipeServerConnection(connectionEndPoint));