C# Класс HttpServer.HttpContextFactory

Used to create and reuse contexts.
Наследование: IHttpContextFactory
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateContext ( Socket socket ) : IHttpClientContext

Creates a IHttpClientContext that handles a connected client.

CreateSecureContext ( Socket socket, X509Certificate certificate, SslProtocols protocol ) : IHttpClientContext

Create a secure IHttpClientContext.

HttpContextFactory ( ILogWriter writer, int bufferSize, IRequestParserFactory factory ) : System

Initializes a new instance of the HttpContextFactory class.

Защищенные методы

Метод Описание
CreateContext ( bool isSecured, IPEndPoint endPoint, Stream stream, Socket sock ) : HttpClientContext

Create a new context.

CreateNewContext ( bool isSecured, IPEndPoint endPoint, Stream stream, Socket sock ) : HttpClientContext

Create a new context.

Приватные методы

Метод Описание
OnFreeContext ( object sender, HttpServer.DisconnectedEventArgs e ) : void
OnRequestReceived ( object sender, HttpServer.RequestEventArgs e ) : void

Описание методов

CreateContext() защищенный Метод

Create a new context.
protected CreateContext ( bool isSecured, IPEndPoint endPoint, Stream stream, Socket sock ) : HttpClientContext
isSecured bool true if socket is running HTTPS.
endPoint System.Net.IPEndPoint Client that connected
stream Stream Network/SSL stream.
sock Socket
Результат HttpClientContext

CreateContext() публичный Метод

Creates a IHttpClientContext that handles a connected client.
public CreateContext ( Socket socket ) : IHttpClientContext
socket Socket Client socket (accepted by the ).
Результат IHttpClientContext

CreateNewContext() защищенный Метод

Create a new context.
protected CreateNewContext ( bool isSecured, IPEndPoint endPoint, Stream stream, Socket sock ) : HttpClientContext
isSecured bool true if HTTPS is used.
endPoint System.Net.IPEndPoint Remote client
stream Stream Network stream, uses .
sock Socket
Результат HttpClientContext

CreateSecureContext() публичный Метод

Create a secure IHttpClientContext.
public CreateSecureContext ( Socket socket, X509Certificate certificate, SslProtocols protocol ) : IHttpClientContext
socket Socket Client socket (accepted by the ).
certificate System.Security.Cryptography.X509Certificates.X509Certificate HTTPS certificate to use.
protocol SslProtocols Kind of HTTPS protocol. Usually TLS or SSL.
Результат IHttpClientContext

HttpContextFactory() публичный Метод

Initializes a new instance of the HttpContextFactory class.
public HttpContextFactory ( ILogWriter writer, int bufferSize, IRequestParserFactory factory ) : System
writer ILogWriter The writer.
bufferSize int Amount of bytes to read from the incoming socket stream.
factory IRequestParserFactory Used to create a request parser.
Результат System