コード例 #1
0
        internal NamedPipeConnectionListener(
            string localEndPointName, ConnectionListenerSettings settings = null)
        {
            _localEndPointName = localEndPointName ?? throw new ArgumentNullException("localEndPointName");
            _settings          = settings ?? new ConnectionListenerSettings();

            if ((_settings.NewConnectionSettings?.UseBufferedStream).GetValueOrDefault())
            {
                throw new NotSupportedException();
            }

            if (string.IsNullOrWhiteSpace(localEndPointName))
            {
                throw new ArgumentException("Invalid pipename", nameof(localEndPointName));
            }
        }
コード例 #2
0
 internal TcpConnectionListener(IPEndPoint localEndPoint, ConnectionListenerSettings settings = null)
 {
     _localEndPoint = localEndPoint ?? throw new ArgumentNullException(nameof(localEndPoint));
     _settings      = settings ?? new ConnectionListenerSettings();
 }
コード例 #3
0
 public static IConnectionListener CreateMultiPeerServer(IPAddress localIp, int localPort, ConnectionListenerSettings settings = null)
 => CreateMultiPeerServer(new IPEndPoint(localIp, localPort), settings);
コード例 #4
0
 public static IConnectionListener CreateMultiPeerServer(string localNamedPipeName, ConnectionListenerSettings settings = null)
 => ServiceRef.Create <IConnectionListener>(new NamedPipeConnectionListener(localNamedPipeName, settings));
コード例 #5
0
 public static IConnectionListener CreateMultiPeerServer(IPEndPoint localEndPoint, ConnectionListenerSettings settings = null)
 => ServiceRef.Create <IConnectionListener>(new TcpConnectionListener(localEndPoint, settings));