C# 클래스 HttpServer.HttpClientContextImp

Contains a connection to a browser/client.
상속: IHttpClientContext
파일 보기 프로젝트 열기: 3di/3di-viewer-rei-libs

공개 메소드들

메소드 설명
Disconnect ( SocketError error ) : void

Disconnect from client

HttpClientContextImp ( bool secured, IPEndPoint remoteEndPoint, RequestReceivedHandler requestHandler, ClientDisconnectedHandler disconnectHandler, Stream stream, ILogWriter writer ) : System

Initializes a new instance of the HttpClientContextImp class.

HttpClientContextImp ( bool secured, IPEndPoint remoteEndPoint, Stream stream, RequestReceivedHandler requestHandler ) : System

Initializes a new instance of the HttpClientContextImp class.

Respond ( string body ) : void

Send a response.

Respond ( string httpVersion, HttpServer.HttpStatusCode statusCode, string reason ) : void

Send a response.

Respond ( string httpVersion, HttpServer.HttpStatusCode statusCode, string reason, string body, string contentType ) : void

Send a response.

Send ( byte buffer ) : void

send a whole buffer

Send ( byte buffer, int offset, int size ) : void

Send data using the stream

보호된 메소드들

메소드 설명
Check100Continue ( ) : void

This method checks the request if a responde to 100-continue should be sent.

100 continue is a value in the Expect header. It's used to let the webserver determine if a request can be handled. The client waits for a reply before sending the body.

비공개 메소드들

메소드 설명
OnReceive ( IAsyncResult ar ) : void
OnRequestCompleted ( IHttpRequest request ) : void

메소드 상세

Check100Continue() 보호된 메소드

This method checks the request if a responde to 100-continue should be sent.
100 continue is a value in the Expect header. It's used to let the webserver determine if a request can be handled. The client waits for a reply before sending the body.
protected Check100Continue ( ) : void
리턴 void

Disconnect() 공개 메소드

Disconnect from client
public Disconnect ( SocketError error ) : void
error SocketError error to report in the delegate.
리턴 void

HttpClientContextImp() 공개 메소드

Initializes a new instance of the HttpClientContextImp class.
If beginreceive fails
public HttpClientContextImp ( bool secured, IPEndPoint remoteEndPoint, RequestReceivedHandler requestHandler, ClientDisconnectedHandler disconnectHandler, Stream stream, ILogWriter writer ) : System
secured bool true if the connection is secured (SSL/TLS)
remoteEndPoint System.Net.IPEndPoint client that connected.
requestHandler RequestReceivedHandler delegate handling incoming requests.
disconnectHandler ClientDisconnectedHandler delegate being called when a client disconnectes
stream Stream Stream used for communication
writer ILogWriter delegate used to write log entries
리턴 System

HttpClientContextImp() 공개 메소드

Initializes a new instance of the HttpClientContextImp class.
If beginreceive fails
public HttpClientContextImp ( bool secured, IPEndPoint remoteEndPoint, Stream stream, RequestReceivedHandler requestHandler ) : System
secured bool true if the connection is secured (SSL/TLS)
remoteEndPoint System.Net.IPEndPoint client that connected
stream Stream Stream used for communication
requestHandler RequestReceivedHandler delegate handling incoming requests.
리턴 System

Respond() 공개 메소드

Send a response.
public Respond ( string body ) : void
body string
리턴 void

Respond() 공개 메소드

Send a response.
public Respond ( string httpVersion, HttpServer.HttpStatusCode statusCode, string reason ) : void
httpVersion string Either HttpHelper.HTTP10 or HttpHelper.HTTP11
statusCode HttpServer.HttpStatusCode http status code
reason string reason for the status code.
리턴 void

Respond() 공개 메소드

Send a response.
If httpVersion is invalid.
public Respond ( string httpVersion, HttpServer.HttpStatusCode statusCode, string reason, string body, string contentType ) : void
httpVersion string Either HttpHelper.HTTP10 or HttpHelper.HTTP11
statusCode HttpServer.HttpStatusCode http status code
reason string reason for the status code.
body string html body contents, can be null or empty.
contentType string A content type to return the body as, ie 'text/html' or 'text/plain', defaults to 'text/html' if null or empty
리턴 void

Send() 공개 메소드

send a whole buffer
public Send ( byte buffer ) : void
buffer byte buffer to send
리턴 void

Send() 공개 메소드

Send data using the stream
public Send ( byte buffer, int offset, int size ) : void
buffer byte Contains data to send
offset int Start position in buffer
size int number of bytes to send
리턴 void