C# Class Bloom.Api.ServerBase

Inheritance: IDisposable
Afficher le fichier Open project: BloomBooks/BloomDesktop Class Usage Examples

Méthodes publiques

Свойство Type Description
portForHttp int

Private Properties

Свойство Type Description
AttemptToOpenPort bool
EnqueueIncomingRequests void
GetLocalPathWithoutQuery string
GetServerStartFailureMessage string
MakeReply void
QueueRequest void
ReportMissingFile void
RequestProcessorLoop void
SpinUpAWorker void
VerifyWeAreNowListening void

Méthodes publiques

Méthode Description
Dispose ( ) : void
GetContentType ( string extension ) : string
StartListening ( ) : void

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool fDisposing ) : void
fDisposing bool
Résultat void

GetContentType() public static méthode

public static GetContentType ( string extension ) : string
extension string
Résultat string

GetLocalPathWithoutQuery() protected static méthode

protected static GetLocalPathWithoutQuery ( IRequestInfo info ) : string
info IRequestInfo
Résultat string

IgnoreFileIfMissing() protected méthode

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
Résultat bool

IsRecursiveRequestContext() protected méthode

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
Résultat bool

ProcessRequest() protected méthode

This method is overridden in classes inheriting from this class to handle specific request types
protected ProcessRequest ( IRequestInfo info ) : bool
info IRequestInfo
Résultat bool

ServerBase() protected méthode

protected ServerBase ( ) : System
Résultat System

StartListening() public méthode

public StartListening ( ) : void
Résultat void

Property Details

portForHttp public_oe static_oe property

public static int portForHttp
Résultat int