Beispiel #1
0
        public Stream GetStream(string source, Dictionary<string, string> p, TcpClient client)
		{
			var res = GetStreamInternal(source, p);
		    if (res == null || res == Stream.Null)
		        return Stream.Null;
			BroadcastStream bs = new BroadcastStream(source, res, client);
			bs.OnClosed += ClosedStream;
		    lock (clients)
		    {
		        if (!clients.ContainsKey(source))
		            clients.Add(source, new List<TcpClient>());
		        clients[source].Add(client);
		    }
		    return bs;
		}
Beispiel #2
0
        public Stream GetStream(string source, Dictionary <string, string> p, TcpClient client)
        {
            var res = GetStreamInternal(source, p);

            if (res == null || res == Stream.Null)
            {
                return(Stream.Null);
            }
            BroadcastStream bs = new BroadcastStream(source, res, client);

            bs.OnClosed += ClosedStream;
            lock (clients)
            {
                if (!clients.ContainsKey(source))
                {
                    clients.Add(source, new List <TcpClient>());
                }
                clients[source].Add(client);
            }
            return(bs);
        }