public RemoteCitpTcpClient(ICitpLogService log, ITcpSocketClient client, CancellationToken cancellationToken)
 {
     _log               = log;
     _client            = client;
     _cancellationToken = cancellationToken;
     RemoteEndPoint     = new IpEndpoint(IpAddress.Parse(client.RemoteAddress), client.RemotePort);
 }
Example #2
0
        public CitpMediaServerService([NotNull] string nicIpAddress,
                                      bool useOriginalMulticastIp, [NotNull] ICitpMediaServerDevice device, bool isStreamingEnabled,
                                      ICitpLogService log = null)
        {
            if (nicIpAddress == null)
            {
                throw new ArgumentNullException(nameof(nicIpAddress));
            }

            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            _log = log ?? new CitpDebugLogger(CitpLoggerLevel.Info);

            _device = device;

            IpAddress ip;

            if (!IpAddress.TryParse(nicIpAddress, out ip))
            {
                throw new ArgumentException("Not a valid IPv4 address", nameof(nicIpAddress));
            }

            _networkService = new CitpNetworkService(_log, ip, useOriginalMulticastIp, _device);

            IsStreamingEnabled = isStreamingEnabled;

            if (isStreamingEnabled)
            {
                _streamingService = new CitpStreamingService(_log, _device, _networkService);
            }
        }
Example #3
0
 public CitpNetworkService(ICitpLogService log, IpAddress nicAddress, bool useOriginalMulticastIp,
                           ICitpVisualizerDevice device)
     : this(log, nicAddress, useOriginalMulticastIp)
 {
     _device     = device;
     _deviceType = CitpPeerType.Visualizer;
 }
 public CitpTcpListenService(ICitpLogService log, IpAddress nicAddress)
 {
     _log        = log;
     _nicAddress = nicAddress;
     _listener   = new TcpSocketListener();
     _listener.ConnectionReceived += connectionReceived;
     _cancellationTokenSource      = new CancellationTokenSource();
 }
Example #5
0
        public CitpUdpService(ICitpLogService log, IpAddress nicIp, bool useOriginalMulticastIp)
        {
            _log   = log;
            _nicIp = nicIp;
            _useOriginalMulticastIp = useOriginalMulticastIp;

            _client = new UdpSocketMulticastClient();
            _client.MessageReceived += messageReceived;
        }
Example #6
0
        private CitpNetworkService(ICitpLogService log, IpAddress nicAddress, bool useOriginalMulticastIp)
        {
            _nicAddress = nicAddress;
            _log        = log;

            _tcpListenService = new CitpTcpListenService(_log, _nicAddress);
            _tcpListenService.ClientConnected    += tcpListenService_ClientConnect;
            _tcpListenService.ClientDisconnected += tcpListenService_ClientDisconnect;
            _tcpListenService.MessageReceived    += tcpListenService_PacketReceived;

            _udpService = new CitpUdpService(_log, _nicAddress, useOriginalMulticastIp);
            _udpService.MessageReceived += udpServiceMessageReceived;
        }
Example #7
0
 public CitpStreamingService(ICitpLogService log, ICitpStreamProvider streamProvider, CitpNetworkService networkService)
 {
     _log            = log;
     _streamProvider = streamProvider;
     _networkService = networkService;
 }