C# Class Microsoft.AspNet.Server.Kestrel.Http.Frame

Inheritance: FrameContext, IFrameControl
显示文件 Open project: Starcounter/KestrelHttpServer Class Usage Examples

Public Methods

Method Description
BeginChunkBytes ( int dataCount ) : ArraySegment
Flush ( ) : void
FlushAsync ( CancellationToken cancellationToken ) : Task
Frame ( Microsoft.AspNet.Server.Kestrel.Http.ConnectionContext context ) : System
OnCompleted ( Task>.Func callback, object state ) : void
OnStarting ( Task>.Func callback, object state ) : void
ProduceContinue ( ) : void
ProduceStartAndFireOnStarting ( bool immediate = true ) : Task
RequestProcessingAsync ( ) : Task

Primary loop which consumes socket input, parses it for protocol framing, and invokes the application delegate for as long as the socket is intended to remain open. The resulting Task from this loop is preserved in a field which is used when the server needs to drain and close all currently active connections.

Reset ( ) : void
ResetResponseHeaders ( ) : void
Start ( ) : void

Called once by Connection class to begin the RequestProcessingAsync loop.

StatusCanHaveBody ( int statusCode ) : bool
Stop ( ) : Task

Should be called when the server wants to initiate a shutdown. The Task returned will become complete when the RequestProcessingAsync function has exited. It is expected that Stop will be called on all active connections, and Task.WaitAll() will be called on every return value.

TakeMessageHeaders ( SocketInput input, FrameRequestHeaders requestHeaders ) : bool
Write ( ArraySegment data ) : void
WriteAsync ( ArraySegment data, CancellationToken cancellationToken ) : Task

Private Methods

Method Description
CreateAsciiByteArraySegment ( string text ) : ArraySegment
CreateResponseHeader ( string status, bool appCompleted ) : IDisposable>.Tuple
FastEnumerable ( ) : object>>.IEnumerable
FastFeatureGet ( Type key ) : object
FastFeatureSet ( Type key, object feature ) : void
FastReset ( ) : void
FireOnCompleted ( ) : Task
FireOnStarting ( ) : Task
GetString ( ArraySegment range, int startIndex, int endIndex ) : string
ProduceEnd ( ) : Task
ProduceStart ( bool immediate, bool appCompleted ) : Task
ReportApplicationError ( Exception ex ) : void
TakeStartLine ( SocketInput input ) : bool
WriteChunked ( ArraySegment data ) : void
WriteChunkedAsync ( ArraySegment data, CancellationToken cancellationToken ) : Task
WriteChunkedResponseSuffix ( ) : void

Method Details

BeginChunkBytes() public static method

public static BeginChunkBytes ( int dataCount ) : ArraySegment
dataCount int
return ArraySegment

Flush() public method

public Flush ( ) : void
return void

FlushAsync() public method

public FlushAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
return Task

Frame() public method

public Frame ( Microsoft.AspNet.Server.Kestrel.Http.ConnectionContext context ) : System
context Microsoft.AspNet.Server.Kestrel.Http.ConnectionContext
return System

OnCompleted() public method

public OnCompleted ( Task>.Func callback, object state ) : void
callback Task>.Func
state object
return void

OnStarting() public method

public OnStarting ( Task>.Func callback, object state ) : void
callback Task>.Func
state object
return void

ProduceContinue() public method

public ProduceContinue ( ) : void
return void

ProduceStartAndFireOnStarting() public method

public ProduceStartAndFireOnStarting ( bool immediate = true ) : Task
immediate bool
return Task

RequestProcessingAsync() public method

Primary loop which consumes socket input, parses it for protocol framing, and invokes the application delegate for as long as the socket is intended to remain open. The resulting Task from this loop is preserved in a field which is used when the server needs to drain and close all currently active connections.
public RequestProcessingAsync ( ) : Task
return Task

Reset() public method

public Reset ( ) : void
return void

ResetResponseHeaders() public method

public ResetResponseHeaders ( ) : void
return void

Start() public method

Called once by Connection class to begin the RequestProcessingAsync loop.
public Start ( ) : void
return void

StatusCanHaveBody() public method

public StatusCanHaveBody ( int statusCode ) : bool
statusCode int
return bool

Stop() public method

Should be called when the server wants to initiate a shutdown. The Task returned will become complete when the RequestProcessingAsync function has exited. It is expected that Stop will be called on all active connections, and Task.WaitAll() will be called on every return value.
public Stop ( ) : Task
return Task

TakeMessageHeaders() public static method

public static TakeMessageHeaders ( SocketInput input, FrameRequestHeaders requestHeaders ) : bool
input SocketInput
requestHeaders FrameRequestHeaders
return bool

Write() public method

public Write ( ArraySegment data ) : void
data ArraySegment
return void

WriteAsync() public method

public WriteAsync ( ArraySegment data, CancellationToken cancellationToken ) : Task
data ArraySegment
cancellationToken System.Threading.CancellationToken
return Task