Esempio n. 1
0
        public StreamingServer(IPAddress ipAddress, StreamSettings settings)
        {
            Identifier      = Guid.NewGuid();
            _streamSettings = settings;
            _symbols        = new Dictionary <string, int>();
            _xeger          = new Xeger(_streamSettings.MessagePattern, new Random(DateTime.Now.Millisecond));

            _listener = new TcpListener(ipAddress, _streamSettings.ListeningPort);
        }
Esempio n. 2
0
        public ClientInfo(TcpClient tcpClient, StreamSettings settings)
        {
            ClientId = Guid.NewGuid();

            _symbols   = new List <string>();
            _tcpClient = tcpClient;
            _settings  = settings;

            StartListening();
        }
        public StreamingServer Add(StreamSettings settings)
        {
            if (_streamSimulators.ContainsKey(settings.ListeningPort))
            {
                throw new ArgumentException("port is already assigned.");
            }

            var simulator = StreamingServer.CreateServer(settings);

            simulator.Start();

            _streamSimulators.Add(simulator.ListeningPort, simulator);
            return(simulator);
        }
Esempio n. 4
0
 public static StreamingServer CreateServer(StreamSettings settings)
 {
     return(new StreamingServer(IPAddress.Any, settings));
 }