/// <summary>
        /// Initializes a HttpListener.
        /// </summary>
        /// <param name="endpoint"></param>
        public HttpListener(IPAddress address, int port) : this()
        {
            LocalEndpoint = new IPEndPoint(
                address,
                port);

            _tcpListener = new TcpListenerAdapter(LocalEndpoint);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpListener"/> class.
 /// </summary>
 /// <param name="endpoint">The endpoint.</param>
 public HttpListener(IPEndPoint endpoint, IHttpHandler handler, CancellationToken cancellationToken) : this(handler, cancellationToken)
 {
     _tcpListener = new TcpListenerAdapter(endpoint, cancellationToken);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpListener"/> class.
 /// </summary>
 /// <param name="endpoint">The endpoint.</param>
 public HttpListener(IPEndPoint endpoint) : this()
 {
     _tcpListener = new TcpListenerAdapter(endpoint);
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpListener"/> class.
 /// </summary>
 /// <param name="endpoint">The endpoint.</param>
 public HttpListener(IPEndPoint endpoint, IHttpHandler handler) : this(handler)
 {
     _tcpListener = new TcpListenerAdapter(endpoint);
 }