/// <summary> /// Initializes a new instance of the <see cref="Server"/> class. /// </summary> /// <param name="factory">Factory used to create objects used in this library.</param> public Server(HttpFactory factory) { ServerName = "C# WebServer"; _server = this; _factory = factory; AuthenticationProvider = new AuthenticationProvider(); }
/// <summary> /// Initializes a new instance of the <see cref="Server"/> class. /// </summary> public Server() { _server = this; _factory = new HttpFactory(); }
/// <summary> /// Initializes a new instance of the <see cref="Server"/> class. /// </summary> /// <param name="factory">Factory used to create objects used in this library.</param> public Server(HttpFactory factory) { _server = this; _factory = factory; }
/// <summary> /// Initializes a new instance of the <see cref="HttpListener"/> class. /// </summary> /// <param name="address">The address.</param> /// <param name="port">The port.</param> /// <param name="httpFactory">The HTTP factory.</param> protected HttpListener(IPAddress address, int port, HttpFactory httpFactory) { Address = address; Port = port; _factory = httpFactory; }
/// <summary> /// Initializes a new instance of the <see cref="HttpListener"/> class. /// </summary> /// <param name="address">The address.</param> /// <param name="port">The port.</param> protected HttpListener(IPAddress address, int port) { Address = address; Port = port; _factory = new HttpFactory(); }
/// <summary> /// Creates a new <see cref="HttpListener"/> instance with default factories. /// </summary> /// <param name="address">Address that the listener should accept connections on.</param> /// <param name="port">Port that listener should accept connections on.</param> /// <param name="factory">Factory used to create different types in the framework.</param> /// <returns>Created HTTP listener.</returns> public static HttpListener Create(IPAddress address, int port, HttpFactory factory) { return(new HttpListener(address, port)); }