|
.NET Framework | |||||||||
| PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT | |||||||||
File System Context. Serves static pages.
| Field Summary | |
|---|---|
| string | docRoot |
| string | mount |
| int | READ_BUFFER_LEN |
| int | readBufferLenSet |
| Fields inherited from class ClintHeyer.Httpd.Context |
|---|
| configuration, contexts, padlock, parent, requiresSession, sessionManager, throttleRate |
| Constructor Summary | |
|---|---|
|
FSContext(string mount, string docRoot, ClintHeyer.Httpd.Context parent, ClintHeyer.Httpd.Lock padlock) Constructor. Defines a mount point, document root, parent context and a lock |
|
|
FSContext(string mount, string docRoot, ClintHeyer.Httpd.Context parent) Constructor. Defines a mount point, document root and parent context |
|
| Property Summary | |
|---|---|
| string |
DocumentRoot
Gets the document root for this context |
| string |
MountedPoint
Gets the mount point for this context |
| string |
Url
Gets the base Url for this context |
| Properties inherited from class ClintHeyer.Httpd.Context |
|---|
| Lock, Parent, RequiresSession, ServerManager, SessionManager, ThrottleRate, TicketIssuer |
| Method Summary | |
|---|---|
| bool |
CanHandleRequest(string request) Can we handle a given request? |
| int | GetReadBufferLen(long throttle) |
| void |
Handle(ClintHeyer.Httpd.HttpRequest request, string extraPath) Handle a request |
| void | HandleRangedRequest(ClintHeyer.Httpd.HttpRequest request, ClintHeyer.Httpd.URI requestUri, ClintHeyer.Httpd.HttpReply reply, System.IO.Stream fs, System.Int64[,] ranges, int readBufferLen) |
| long |
NormaliseRange(long start, long end, long length) Normalises relatives ranges to a file-based range. |
| void | OnThrottleChange(ClintHeyer.Httpd.ThrottleChangeEvent args) |
| void |
SendFile(ClintHeyer.Httpd.URI requestURI, string path, ClintHeyer.Httpd.HttpReply reply, ClintHeyer.Httpd.HttpRequest request) Sends a file to requester |
| void |
SendRange(ClintHeyer.Httpd.HttpRequest request, ClintHeyer.Httpd.HttpReply reply, System.IO.Stream stream, long start, long end, string contentType, int readBufferLen) Sends a byte range |
| void |
SendStream(ClintHeyer.Httpd.HttpRequest request, ClintHeyer.Httpd.HttpReply reply, System.IO.Stream stream, System.IO.BinaryReader reader, int readBufferLen) Sends data stream |
| string |
ToString() Gets a string representation of context. In the form of mountPoint > docRoot |
| Methods inherited from class ClintHeyer.Httpd.Context |
|---|
| AddContext, AddResponseHandler, GetContexts, GetMimeType, GetResponseHandler, IConfigurable.Get, IConfigurable.GetBool, IConfigurable.GetFloat, IConfigurable.GetInt, IConfigurable.GetString, LoadConfig, OnReplyCompleted, OnReplyCompletedEvent, OnReplyStarted, OnReplyStartedEvent, OnThrottleChangeEvent, RemoveContext, SaveConfig |
| Methods inherited from class System.Object |
|---|
| Equals, Finalize, GetHashCode, GetType, MemberwiseClone |
| Events inherited from class ClintHeyer.Httpd.Context |
|---|
| ReplyCompleted, ReplyStarted, ThrottleChange |
| Field Detail |
|---|
protected string docRoot
protected string mount
public int READ_BUFFER_LEN
protected int readBufferLenSet
| Constructor Detail |
|---|
public FSContext(string mount,
string docRoot,
ClintHeyer.Httpd.Context parent,
ClintHeyer.Httpd.Lock padlock)
Constructor. Defines a mount point, document root, parent context and a lock
Parameters:
mount - Mount pointdocRoot - Document rootparent - Parent contextpadlock - Lock (or null)public FSContext(string mount,
string docRoot,
ClintHeyer.Httpd.Context parent)
Constructor. Defines a mount point, document root and parent context
Parameters:
mount - Mount pointdocRoot - Document rootparent - Parent context| Property Detail |
|---|
public string DocumentRoot
Gets the document root for this context
public string MountedPoint
Gets the mount point for this context
public string Url
Gets the base Url for this context
| Method Detail |
|---|
public bool CanHandleRequest(string request)
Can we handle a given request?
Parameters:
request - Requestprivate int GetReadBufferLen(long throttle)
public void Handle(ClintHeyer.Httpd.HttpRequest request,
string extraPath)
Handle a request
Parameters:
request - RequestextraPath - Extra pathClintHeyer.Httpd.ResourceLockedException - Lockedprivate void HandleRangedRequest(ClintHeyer.Httpd.HttpRequest request,
ClintHeyer.Httpd.URI requestUri,
ClintHeyer.Httpd.HttpReply reply,
System.IO.Stream fs,
System.Int64[,] ranges,
int readBufferLen)
private long NormaliseRange(long start,
long end,
long length)
Normalises relatives ranges to a file-based range.
Parameters:
start - Startend - Endlength - Length of fileprotected void OnThrottleChange(ClintHeyer.Httpd.ThrottleChangeEvent args)
protected void SendFile(ClintHeyer.Httpd.URI requestURI,
string path,
ClintHeyer.Httpd.HttpReply reply,
ClintHeyer.Httpd.HttpRequest request)
Sends a file to requester
Parameters:
requestURI - Request URIpath - Pathreply - Replyrequest - Requestprivate void SendRange(ClintHeyer.Httpd.HttpRequest request,
ClintHeyer.Httpd.HttpReply reply,
System.IO.Stream stream,
long start,
long end,
string contentType,
int readBufferLen)
Sends a byte range
Parameters:
request - Requestreply - Replystream - Stream to read fromstart - Start position (normalised)end - EndcontentType - Content typereadBufferLen - Read buffer lengthprotected void SendStream(ClintHeyer.Httpd.HttpRequest request,
ClintHeyer.Httpd.HttpReply reply,
System.IO.Stream stream,
System.IO.BinaryReader reader,
int readBufferLen)
Sends data stream
Parameters:
reply - Replystream - Stream to read from. Can be pre-seekedreader - ReaderreadBufferLen - Read buffer sizerequest - Requestpublic string ToString()
Gets a string representation of context. In the form of
mountPoint > docRoot
Returns:
|
.NET Framework | |||||||||
| PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT | |||||||||