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); }
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); }