/// <summary> /// Convenience method for <see cref="ServerChannel.Start"/> that looks more idiomatic to typical /// channel creation methods on <see cref="IChannelProvider"/>. /// </summary> /// <param name="provider">The channel provider.</param> /// <param name="identifier">This is an identifier of the "type" of bundle that is being published, /// and should form a path with forward-slash '/' delimiters.</param> /// <returns>The newly created server channel, or <c>null</c> if there was no listener for /// server channels on <paramref name="provider"/>.</returns> public static ServerChannel StartServerChannel(this IChannelProvider provider, string identifier) { Contracts.CheckValue(provider, nameof(provider)); Contracts.CheckNonWhiteSpace(identifier, nameof(identifier)); return(ServerChannel.Start(provider, identifier)); }
/// <summary> /// Create an output "file" and return a handle to it. /// </summary> public static IFileHandle CreateOutputFile(this IHostEnvironment env, string path) { Contracts.AssertValue(env); Contracts.CheckNonWhiteSpace(path, nameof(path)); return(new SimpleFileHandle(env, path, needsWrite: true, autoDelete: false)); }