C# Класс Bloom.Api.ServerBase

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
portForHttp int

Private Properties

Свойство Тип Описание
AttemptToOpenPort bool
EnqueueIncomingRequests void
GetLocalPathWithoutQuery string
GetServerStartFailureMessage string
MakeReply void
QueueRequest void
ReportMissingFile void
RequestProcessorLoop void
SpinUpAWorker void
VerifyWeAreNowListening void

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

Метод Описание
Dispose ( ) : void
GetContentType ( string extension ) : string
StartListening ( ) : void

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

Метод Описание
Dispose ( bool fDisposing ) : void
GetLocalPathWithoutQuery ( IRequestInfo info ) : string
IgnoreFileIfMissing ( string localPath ) : bool

Check for files that may be missing but that we know aren't important enough to complain about.

IsRecursiveRequestContext ( HttpListenerContext context ) : bool

Return true if producing the result requested by the context may involve making additional requests to the server. (See the fuller discussion on the declaration of _threadsDoingRecursiveRequests.)

ProcessRequest ( IRequestInfo info ) : bool

This method is overridden in classes inheriting from this class to handle specific request types

ServerBase ( ) : System

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

Метод Описание
AttemptToOpenPort ( ) : bool

Tries to start listening on the currently proposed server url

EnqueueIncomingRequests ( ) : void

The _listenerThread runs this method, and exits when the _stop event is raised

GetLocalPathWithoutQuery ( string localPath ) : string
GetServerStartFailureMessage ( ) : string
MakeReply ( IRequestInfo info ) : void

This is designed to be easily unit testable by not taking actual HttpContext, but doing everything through this IRequestInfo object

QueueRequest ( IAsyncResult ar ) : void

This method is called in the _listenerThread when we obtain an HTTP request from the _listener, and queues it for processing by a worker.

ReportMissingFile ( IRequestInfo info ) : void
RequestProcessorLoop ( ) : void

The worker threads run this function

SpinUpAWorker ( ) : void
VerifyWeAreNowListening ( ) : void

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

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

public Dispose ( ) : void
Результат void

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

protected Dispose ( bool fDisposing ) : void
fDisposing bool
Результат void

GetContentType() публичный статический Метод

public static GetContentType ( string extension ) : string
extension string
Результат string

GetLocalPathWithoutQuery() защищенный статический Метод

protected static GetLocalPathWithoutQuery ( IRequestInfo info ) : string
info IRequestInfo
Результат string

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

Check for files that may be missing but that we know aren't important enough to complain about.
protected IgnoreFileIfMissing ( string localPath ) : bool
localPath string
Результат bool

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

Return true if producing the result requested by the context may involve making additional requests to the server. (See the fuller discussion on the declaration of _threadsDoingRecursiveRequests.)
protected IsRecursiveRequestContext ( HttpListenerContext context ) : bool
context System.Net.HttpListenerContext
Результат bool

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

This method is overridden in classes inheriting from this class to handle specific request types
protected ProcessRequest ( IRequestInfo info ) : bool
info IRequestInfo
Результат bool

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

protected ServerBase ( ) : System
Результат System

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

public StartListening ( ) : void
Результат void

Описание свойств

portForHttp публичное статическое свойство

public static int portForHttp
Результат int