示例#1
0
        ChunkWriter GetWriter(Uri uri)
        {
            string key = uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped);

            ChunkWriter result;

            if (_writers.TryGetValue(key, out result))
            {
                return(result);
            }

            if ("pgm".Equals(uri.Scheme, StringComparison.InvariantCultureIgnoreCase) ||
                "rm".Equals(uri.Scheme, StringComparison.InvariantCultureIgnoreCase))
            {
                result = CreateReliableMulticastWriter(uri);

                _writers.Add(key, result);
                return(result);
            }

            if ("loopback".Equals(uri.Scheme, StringComparison.InvariantCultureIgnoreCase))
            {
                result = new LoopbackReaderWriter(new PoolFiber());

                _writers.Add(key, result);
                return(result);
            }

            throw new StactException("Unsupported remote address: " + uri);
        }
示例#2
0
		ChunkWriter GetWriter(Uri uri)
		{
			string key = uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped);

			ChunkWriter result;
			if (_writers.TryGetValue(key, out result))
				return result;

			if ("pgm".Equals(uri.Scheme, StringComparison.InvariantCultureIgnoreCase)
				|| "rm".Equals(uri.Scheme, StringComparison.InvariantCultureIgnoreCase))
			{
				result = CreateReliableMulticastWriter(uri);

				_writers.Add(key, result);
				return result;
			}

			if ("loopback".Equals(uri.Scheme, StringComparison.InvariantCultureIgnoreCase))
			{
				result =  new LoopbackReaderWriter(new PoolFiber());

				_writers.Add(key, result);
				return result;
			}

			throw new StactException("Unsupported remote address: " + uri);
		}