public DeviceLocator(ISocketFactory socketFactory, IRequestFactory requestFactory, IMessageParser messageParser, IDeviceInfoCollector deviceInfoCollector) { _socketFactory = socketFactory; _requestFactory = requestFactory; _messageParser = messageParser; _deviceInfoCollector = deviceInfoCollector; }
public DiscoveryListener(ISocketFactory socketFactory, IResponseFactory responseFactory, IMessageParser messageParser, IDeviceInfoCollector deviceInfoCollector) { _socketFactory = socketFactory; _responseFactory = responseFactory; _messageParser = messageParser; _deviceInfoCollector = deviceInfoCollector; _stopped = true; _started = false; }
public IntercomMessageHub(ISocketFactory socketFactory, ISynodConfiguration synodConfig, ILogger logger) { this.socketFactory = socketFactory; this.logger = logger; cancellationTokenSource = new CancellationTokenSource(); this.synodConfig = synodConfig; inMessageQueue = new BlockingCollection<IMessage>(new ConcurrentQueue<IMessage>()); outMessageQueue = new BlockingCollection<IntercomMessage>(new ConcurrentQueue<IntercomMessage>()); subscriptions = new ConcurrentDictionary<Listener, object>(); }
/// <summary> /// Creates a new <see cref="DiceConnectionFactory"/> using the delivered <see cref="ISocketFactory"/> /// for creating the underlying <see cref="ISocket"/> connection /// </summary> /// <param name="socketFactory"></param> public DiceConnectionFactory(ISocketFactory socketFactory) { #region Contracts if (socketFactory == null) { throw new ArgumentNullException("socketFactory"); } #endregion Contracts SocketFactory = socketFactory; }
public RendezvousService(ILeaseProvider leaseProvider, ISynodConfiguration synodConfig, ISocketFactory socketFactory, RendezvousConfiguration config, ILogger logger) { this.socketFactory = socketFactory; this.logger = logger; localNode = synodConfig.LocalNode; this.leaseProvider = leaseProvider; this.config = config; cancellationTokenSource = new CancellationTokenSource(); }
public MessageHub(ISocketFactory socketFactory, ICallbackHandlerStack callbackHandlers, MessageHubConfiguration config, IMessageTracer messageTracer, ILogger logger) { this.logger = logger; this.messageTracer = messageTracer; this.socketFactory = socketFactory; this.config = config; receivingSocketIdentityPromise = new TaskCompletionSource<byte[]>(); hubRegistered = new ManualResetEventSlim(); this.callbackHandlers = callbackHandlers; registrationsQueue = new BlockingCollection<CallbackRegistration>(new ConcurrentQueue<CallbackRegistration>()); cancellationTokenSource = new CancellationTokenSource(); }
/// <summary> /// Full constructor. /// </summary> /// <param name="socketFactory">An implementation of the <see cref="ISocketFactory"/> interface that can be used to make new unicast and multicast sockets. Cannot be null.</param> /// <param name="localPort">The specific local port to use for all sockets created by this instance. Specify zero to indicate the system should choose a free port itself.</param> /// <param name="multicastTimeToLive">The multicast time to live value for multicast sockets. Technically this is a number of router hops, not a 'Time'. Must be greater than zero.</param> /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception> /// <exception cref="System.ArgumentOutOfRangeException">The <paramref name="multicastTimeToLive"/> argument is less than or equal to zero.</exception> public SsdpCommunicationsServer(ISocketFactory socketFactory, int localPort, int multicastTimeToLive) { if (socketFactory == null) throw new ArgumentNullException("socketFactory"); if (multicastTimeToLive <= 0) throw new ArgumentOutOfRangeException("multicastTimeToLive", "multicastTimeToLive must be greater than zero."); _BroadcastListenSocketSynchroniser = new object(); _SendSocketSynchroniser = new object(); _LocalPort = localPort; _SocketFactory = socketFactory; _RequestParser = new HttpRequestParser(); _ResponseParser = new HttpResponseParser(); _MulticastTtl = multicastTimeToLive; }
public ClusterMonitorProvider(ISocketFactory socketFactory, RouterConfiguration routerConfiguration, IClusterMembership clusterMembership, ClusterMembershipConfiguration membershipConfiguration, IRendezvousCluster rendezvousCluster, ILogger logger) { clusterMonitor = membershipConfiguration.RunAsStandalone ? (IClusterMonitor) new LoopbackClusterMonitor() : new ClusterMonitor(socketFactory, routerConfiguration, clusterMembership, membershipConfiguration, rendezvousCluster, logger); }
public ClusterMonitor(ISocketFactory socketFactory, RouterConfiguration routerConfiguration, IClusterMembership clusterMembership, ClusterMembershipConfiguration membershipConfiguration, IRendezvousCluster rendezvousCluster, ILogger logger) { this.logger = logger; this.membershipConfiguration = membershipConfiguration; pingReceived = new ManualResetEventSlim(false); newRendezvousConfiguration = new ManualResetEventSlim(false); this.socketFactory = socketFactory; this.routerConfiguration = routerConfiguration; this.clusterMembership = clusterMembership; this.rendezvousCluster = rendezvousCluster; outgoingMessages = new BlockingCollection<IMessage>(new ConcurrentQueue<IMessage>()); }
public MessageRouter(ISocketFactory socketFactory, IInternalRoutingTable internalRoutingTable, IExternalRoutingTable externalRoutingTable, RouterConfiguration routerConfiguration, IClusterMonitor clusterMonitor, IMessageTracer messageTracer, ILogger logger) { this.logger = logger; this.messageTracer = messageTracer; this.socketFactory = socketFactory; localSocketIdentityPromise = new TaskCompletionSource<byte[]>(); this.internalRoutingTable = internalRoutingTable; this.externalRoutingTable = externalRoutingTable; this.clusterMonitor = clusterMonitor; this.routerConfiguration = routerConfiguration; cancellationTokenSource = new CancellationTokenSource(); }
public ActorHost(ISocketFactory socketFactory, IActorHandlerMap actorHandlerMap, IAsyncQueue<AsyncMessageContext> asyncQueue, IAsyncQueue<IActor> actorRegistrationsQueue, RouterConfiguration routerConfiguration, IMessageTracer messageTracer, ILogger logger) { this.logger = logger; this.messageTracer = messageTracer; this.actorHandlerMap = actorHandlerMap; localSocketIdentityPromise = new TaskCompletionSource<byte[]>(); this.socketFactory = socketFactory; this.routerConfiguration = routerConfiguration; this.asyncQueue = asyncQueue; this.actorRegistrationsQueue = actorRegistrationsQueue; cancellationTokenSource = new CancellationTokenSource(); }
public EndPointListener(HttpListener listener, IpAddressInfo addr, int port, bool secure, ICertificate cert, ILogger logger, ICryptoProvider cryptoProvider, IStreamFactory streamFactory, ISocketFactory socketFactory, IMemoryStreamFactory memoryStreamFactory, ITextEncoding textEncoding, IFileSystem fileSystem) { this.listener = listener; _logger = logger; _cryptoProvider = cryptoProvider; _streamFactory = streamFactory; _socketFactory = socketFactory; _memoryStreamFactory = memoryStreamFactory; _textEncoding = textEncoding; _fileSystem = fileSystem; this.secure = secure; this.cert = cert; _enableDualMode = addr.Equals(IpAddressInfo.IPv6Any); endpoint = new IpEndPointInfo(addr, port); prefixes = new Dictionary <ListenerPrefix, HttpListener>(); unregistered = new Dictionary <HttpConnection, HttpConnection>(); CreateSocket(); }
/// <summary> /// Partial constructor. /// </summary> /// <param name="socketFactory">An implementation of the <see cref="ISocketFactory"/> interface that can be used to make new unicast and multicast sockets. Cannot be null.</param> /// <param name="localPort">The specific local port to use for all sockets created by this instance. Specify zero to indicate the system should choose a free port itself.</param> /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception> public CommunicationsServer(ISocketFactory socketFactory, int localPort) : this(socketFactory, localPort, SsdpConstants.SsdpDefaultMulticastTimeToLive) { }
/// <summary> /// Minimum constructor. /// </summary> /// <param name="socketFactory">An implementation of the <see cref="ISocketFactory"/> interface that can be used to make new unicast and multicast sockets. Cannot be null.</param> /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception> public CommunicationsServer(ISocketFactory socketFactory) : this(socketFactory, 0, SsdpConstants.SsdpDefaultMulticastTimeToLive) { }
public DlnaEntryPoint(IServerConfigurationManager config, ILogManager logManager, IServerApplicationHost appHost, ISessionManager sessionManager, IHttpClient httpClient, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IImageProcessor imageProcessor, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IDeviceDiscovery deviceDiscovery, IMediaEncoder mediaEncoder, ISocketFactory socketFactory, ITimerFactory timerFactory, IEnvironmentInfo environmentInfo, INetworkManager networkManager) { _config = config; _appHost = appHost; _sessionManager = sessionManager; _httpClient = httpClient; _libraryManager = libraryManager; _userManager = userManager; _dlnaManager = dlnaManager; _imageProcessor = imageProcessor; _userDataManager = userDataManager; _localization = localization; _mediaSourceManager = mediaSourceManager; _deviceDiscovery = deviceDiscovery; _mediaEncoder = mediaEncoder; _socketFactory = socketFactory; _timerFactory = timerFactory; _environmentInfo = environmentInfo; _networkManager = networkManager; _logger = logManager.GetLogger("Dlna"); }
public HdHomerunManager(ISocketFactory socketFactory, ILogger logger) { _socketFactory = socketFactory; _logger = logger; }
/// <summary> /// Partial constructor. /// </summary> /// <param name="socketFactory">An implementation of the <see cref="ISocketFactory"/> interface that can be used to make new unicast and multicast sockets. Cannot be null.</param> /// <param name="localPort">The specific local port to use for all sockets created by this instance. Specify zero to indicate the system should choose a free port itself.</param> /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception> public SsdpCommunicationsServer(ISocketFactory socketFactory, int localPort) : this(socketFactory, localPort, SsdpConstants.SsdpDefaultMulticastTimeToLive) { }
/// <summary> /// Minimum constructor. /// </summary> /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception> public SsdpCommunicationsServer(ISocketFactory socketFactory, INetworkManager networkManager, ILogger logger, bool enableMultiSocketBinding) : this(socketFactory, 0, SsdpConstants.SsdpDefaultMulticastTimeToLive, networkManager, logger, enableMultiSocketBinding) { }
public HttpEndPointListener(HttpListener listener, IPAddress addr, int port, bool secure, X509Certificate cert, ILogger logger, ICryptoProvider cryptoProvider, ISocketFactory socketFactory, IMemoryStreamFactory memoryStreamFactory, ITextEncoding textEncoding, IFileSystem fileSystem, IEnvironmentInfo environment) { this._listener = listener; _logger = logger; _cryptoProvider = cryptoProvider; _socketFactory = socketFactory; _memoryStreamFactory = memoryStreamFactory; _textEncoding = textEncoding; _fileSystem = fileSystem; _environment = environment; this._secure = secure; this._cert = cert; _enableDualMode = addr.Equals(IPAddress.IPv6Any); _endpoint = new IPEndPoint(addr, port); _prefixes = new Dictionary <ListenerPrefix, HttpListener>(); _unregisteredConnections = new Dictionary <HttpConnection, HttpConnection>(); CreateSocket(); }
public HttpListenerHost(IServerApplicationHost applicationHost, ILogger logger, IServerConfigurationManager config, string serviceName, string defaultRedirectPath, INetworkManager networkManager, IMemoryStreamFactory memoryStreamProvider, ITextEncoding textEncoding, ISocketFactory socketFactory, ICryptoProvider cryptoProvider, IJsonSerializer jsonSerializer, IXmlSerializer xmlSerializer, IEnvironmentInfo environment, X509Certificate certificate, Func <Type, Func <string, object> > funcParseFn, bool enableDualModeSockets, IFileSystem fileSystem) { Instance = this; _appHost = applicationHost; DefaultRedirectPath = defaultRedirectPath; _networkManager = networkManager; _memoryStreamProvider = memoryStreamProvider; _textEncoding = textEncoding; _socketFactory = socketFactory; _cryptoProvider = cryptoProvider; _jsonSerializer = jsonSerializer; _xmlSerializer = xmlSerializer; _environment = environment; _certificate = certificate; _funcParseFn = funcParseFn; _enableDualModeSockets = enableDualModeSockets; _fileSystem = fileSystem; _config = config; _logger = logger; RequestFilters = new Action <IRequest, IResponse, object>[] { }; ResponseFilters = new Action <IRequest, IResponse, object>[] { }; }
public virtual SocketOptions SetSocketFactory(ISocketFactory socketFactory) { _socketFactory = socketFactory; return(this); }
/// <summary> /// Initializes a new instance of the <see cref="UdpServer" /> class. /// </summary> public UdpServer(ILogger logger, IServerApplicationHost appHost, IJsonSerializer json, ISocketFactory socketFactory) { _logger = logger; _appHost = appHost; _json = json; _socketFactory = socketFactory; AddMessageResponder("who is JellyfinServer?", true, RespondToV2Message); AddMessageResponder("who is EmbyServer?", true, RespondToV2Message); AddMessageResponder("who is MediaBrowserServer_v2?", false, RespondToV2Message); }
public DlnaEntryPoint( IServerConfigurationManager config, ILoggerFactory loggerFactory, IServerApplicationHost appHost, ISessionManager sessionManager, IHttpClient httpClient, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IImageProcessor imageProcessor, IUserDataManager userDataManager, ILocalizationManager localizationManager, IMediaSourceManager mediaSourceManager, IDeviceDiscovery deviceDiscovery, IMediaEncoder mediaEncoder, ISocketFactory socketFactory, INetworkManager networkManager, IUserViewManager userViewManager, ITVSeriesManager tvSeriesManager) { _config = config; _appHost = appHost; _sessionManager = sessionManager; _httpClient = httpClient; _libraryManager = libraryManager; _userManager = userManager; _dlnaManager = dlnaManager; _imageProcessor = imageProcessor; _userDataManager = userDataManager; _localization = localizationManager; _mediaSourceManager = mediaSourceManager; _deviceDiscovery = deviceDiscovery; _mediaEncoder = mediaEncoder; _socketFactory = socketFactory; _networkManager = networkManager; _logger = loggerFactory.CreateLogger <DlnaEntryPoint>(); ContentDirectory = new ContentDirectory.ContentDirectoryService( dlnaManager, userDataManager, imageProcessor, libraryManager, config, userManager, loggerFactory.CreateLogger <ContentDirectory.ContentDirectoryService>(), httpClient, localizationManager, mediaSourceManager, userViewManager, mediaEncoder, tvSeriesManager); ConnectionManager = new ConnectionManager.ConnectionManagerService( dlnaManager, config, loggerFactory.CreateLogger <ConnectionManager.ConnectionManagerService>(), httpClient); MediaReceiverRegistrar = new MediaReceiverRegistrar.MediaReceiverRegistrarService( loggerFactory.CreateLogger <MediaReceiverRegistrar.MediaReceiverRegistrarService>(), httpClient, config); Current = this; }
public HdHomerunHost(IServerConfigurationManager config, ILogger logger, IJsonSerializer jsonSerializer, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IHttpClient httpClient, IServerApplicationHost appHost, ISocketFactory socketFactory, INetworkManager networkManager, IEnvironmentInfo environment) : base(config, logger, jsonSerializer, mediaEncoder, fileSystem) { _httpClient = httpClient; _appHost = appHost; _socketFactory = socketFactory; _networkManager = networkManager; _environment = environment; }
/// <summary> /// Minimum constructor. /// </summary> /// <param name="socketFactory">An implementation of the <see cref="ISocketFactory"/> interface that can be used to make new unicast and multicast sockets. Cannot be null.</param> /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception> public SsdpCommunicationsServer(ISocketFactory socketFactory) : this(socketFactory, 0, SsdpConstants.SsdpDefaultMulticastTimeToLive) { }
void setSocketFactory(ISocketFactory factory) { this.factory = factory; }
internal NatsConnectionManager(ISocketFactory socketFactory) { _socketFactory = socketFactory ?? throw new ArgumentNullException(nameof(socketFactory)); }
internal static void addPort(Session session, int port, String target, int lport, ISocketFactory factory) { lock (pool) { if (getPort(session, port) != null) { throw new SshClientException("PortForwardingR: remote port " + port + " is already registered."); } Object[] foo = new Object[5]; foo[0] = session; foo[1] = port; foo[2] = target; foo[3] = lport; foo[4] = factory; pool.Add(foo); } }
public virtual SocketOptions SetSocketFactory(ISocketFactory socketFactory) { _socketFactory = socketFactory; return this; }
public DlnaEntryPoint( IServerConfigurationManager config, ILoggerFactory loggerFactory, IServerApplicationHost appHost, ISessionManager sessionManager, IHttpClientFactory httpClientFactory, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IImageProcessor imageProcessor, IUserDataManager userDataManager, ILocalizationManager localizationManager, IMediaSourceManager mediaSourceManager, IDeviceDiscovery deviceDiscovery, IMediaEncoder mediaEncoder, ISocketFactory socketFactory, INetworkManager networkManager, IUserViewManager userViewManager, ITVSeriesManager tvSeriesManager) { _config = config; _appHost = appHost; _sessionManager = sessionManager; _httpClientFactory = httpClientFactory; _libraryManager = libraryManager; _userManager = userManager; _dlnaManager = dlnaManager; _imageProcessor = imageProcessor; _userDataManager = userDataManager; _localization = localizationManager; _mediaSourceManager = mediaSourceManager; _deviceDiscovery = deviceDiscovery; _mediaEncoder = mediaEncoder; _socketFactory = socketFactory; _networkManager = networkManager; _logger = loggerFactory.CreateLogger <DlnaEntryPoint>(); ContentDirectory = new ContentDirectory.ContentDirectoryService( dlnaManager, userDataManager, imageProcessor, libraryManager, config, userManager, loggerFactory.CreateLogger <ContentDirectory.ContentDirectoryService>(), httpClientFactory, localizationManager, mediaSourceManager, userViewManager, mediaEncoder, tvSeriesManager); ConnectionManager = new ConnectionManager.ConnectionManagerService( dlnaManager, config, loggerFactory.CreateLogger <ConnectionManager.ConnectionManagerService>(), httpClientFactory); MediaReceiverRegistrar = new MediaReceiverRegistrar.MediaReceiverRegistrarService( loggerFactory.CreateLogger <MediaReceiverRegistrar.MediaReceiverRegistrarService>(), httpClientFactory, config); Current = this; _netConfig = config.GetConfiguration <NetworkConfiguration>("network"); _disabled = appHost.ListenWithHttps && _netConfig.RequireHttps; if (_disabled && _config.GetDlnaConfiguration().EnableServer) { _logger.LogError("The DLNA specification does not support HTTPS."); } }