|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
HTTP reply
Field Summary | |
---|---|
System.Collections.ArrayList | buffer |
bool | buffered |
long | bufferSize |
bool | chunked |
bool | closed |
string | contentType |
ClintHeyer.Httpd.Context | context |
ClintHeyer.Httpd.IEncoder | encoder |
System.Collections.ArrayList | header |
bool | headersSent |
bool | keepAlive |
long | length |
ClintHeyer.Httpd.HttpRequest | request |
ClintHeyer.Httpd.HttpResponse | response |
bool | sectionStarted |
long | sent |
ClintHeyer.Httpd.HttpSession | session |
long | throttleRate |
Constructor Summary | |
---|---|
HttpReply(ClintHeyer.Httpd.HttpRequest request) Constructor, attempts to work out context manually (based on request) |
|
HttpReply(ClintHeyer.Httpd.HttpRequest request, ClintHeyer.Httpd.Context handlingContext) Constructor |
Property Summary | |
---|---|
bool |
Buffered
Gets or sets whether output is buffered |
bool |
Chunked
Gets or sets whether output is chunked |
long |
ContentLength
Gets the content length |
string |
ContentType
Gets or sets the content type of the reply |
ClintHeyer.Httpd.IEncoder |
Encoder
Gets or sets the encoder to use |
bool |
HeadersSent
Have the headers been sent already? |
bool |
IsClosed
Has the request been closed? |
bool |
KeepAlive
Gets or sets whether keep alive is used |
ClintHeyer.Httpd.HttpRequest |
Request
Gets the request that triggered this reply |
ClintHeyer.Httpd.HttpResponse |
Response
Gets or sets the Response |
long |
Sent
Number of bytes sent (including headers) |
long |
ThrottleRate
Gets current throttle rate |
long |
TransferRate
Bytes per second of transfer |
Method Summary | |
---|---|
void |
AddHeader(string name, string val) Adds a header |
void |
AddRawHeader(string raw) Adds a raw header into the reply. Ensure it is properly formed |
void | BufferAdd(byte[] data, int length) |
void |
Close() Finishes off sending a reply (automatically closes off an open section). |
void |
EndSection() Closes a section |
void |
FlushBuffer() Flushes any buffered data, including buffered data in any current chunk |
void |
FlushBuffer(bool chunkExempt) Flushes any buffered data |
void | OnThrottleRateChanged(ClintHeyer.Httpd.Context sender, ClintHeyer.Httpd.ThrottleChangeEvent args) |
void |
SendChunkHeader(long size) Sends a chunk header of known size |
void |
SendCRLF() Sends a new line |
void |
SendData(string data) Sends a string without a CRLF on the end |
void | SendHeaders() |
void | SendImpl(byte[] data) |
void | SendImpl(byte[] data, int length) |
void | SendImpl(string data) |
void |
SendLine(string data) Sends text with a CRLF at the end (used for sending individual lines of text) |
void |
SendSection(byte[] data) Sends byte data |
void |
SendSection(string data) Sends string data |
void |
SendSection(byte[] data, int length) Sends data |
void |
StartSection() Starts a section of unknown size |
void |
StartSection(long knownSize) Starts a section of known size |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Field Detail |
---|
private System.Collections.ArrayList buffer
private bool buffered
private long bufferSize
private bool chunked
private bool closed
private string contentType
private ClintHeyer.Httpd.Context context
private ClintHeyer.Httpd.IEncoder encoder
private System.Collections.ArrayList header
private bool headersSent
private bool keepAlive
private long length
private ClintHeyer.Httpd.HttpRequest request
private ClintHeyer.Httpd.HttpResponse response
private bool sectionStarted
private long sent
private ClintHeyer.Httpd.HttpSession session
private long throttleRate
Constructor Detail |
---|
public HttpReply(ClintHeyer.Httpd.HttpRequest request)
Constructor, attempts to work out context manually (based on request)
Parameters:
request
- Original requestpublic HttpReply(ClintHeyer.Httpd.HttpRequest request, ClintHeyer.Httpd.Context handlingContext)
Constructor
Parameters:
request
- Original requesthandlingContext
- Context it's served fromProperty Detail |
---|
public bool Buffered
Gets or sets whether output is buffered
public bool Chunked
Gets or sets whether output is chunked
Throws:
System.InvalidOperationException
- If turned on when HTTP version is 1.0public long ContentLength
Gets the content length
public string ContentType
Gets or sets the content type of the reply
Throws:
System.InvalidOperationException
- Set after headers have been sentpublic ClintHeyer.Httpd.IEncoder Encoder
Gets or sets the encoder to use
Throws:
System.InvalidOperationException
- When encoder hpublic bool HeadersSent
Have the headers been sent already?
public bool IsClosed
Has the request been closed?
public bool KeepAlive
Gets or sets whether keep alive is used
public ClintHeyer.Httpd.HttpRequest Request
Gets the request that triggered this reply
public ClintHeyer.Httpd.HttpResponse Response
Gets or sets the Response
Throws:
System.InvalidOperationException
- Response set after headers have been sentpublic long Sent
Number of bytes sent (including headers)
public long ThrottleRate
Gets current throttle rate
public long TransferRate
Bytes per second of transfer
Method Detail |
---|
public void AddHeader(string name, string val)
Adds a header
Parameters:
name
- Nameval
- ValueSystem.InvalidOperationException
- Headers have already been sentpublic void AddRawHeader(string raw)
Adds a raw header into the reply. Ensure it is properly formed
Parameters:
raw
- Raw headerSystem.InvalidOperationException
- Headers have already been sentprivate void BufferAdd(byte[] data, int length)
public void Close()
Finishes off sending a reply (automatically closes off an open section).
public void EndSection()
Closes a section
Throws:
System.InvalidOperationException
- A section has not been startedpublic void FlushBuffer()
Flushes any buffered data, including buffered data in any current chunk
public void FlushBuffer(bool chunkExempt)
Flushes any buffered data
Parameters:
chunkExempt
- Should buffered data be exempt from any current chunk?private void OnThrottleRateChanged(ClintHeyer.Httpd.Context sender, ClintHeyer.Httpd.ThrottleChangeEvent args)
private void SendChunkHeader(long size)
Sends a chunk header of known size
Parameters:
size
- SizeSystem.ArgumentOutOfRangeException
- Size is less than zeropublic void SendCRLF()
Sends a new line
public void SendData(string data)
Sends a string without a CRLF on the end
Parameters:
data
- private void SendHeaders()
private void SendImpl(byte[] data)
private void SendImpl(byte[] data, int length)
private void SendImpl(string data)
public void SendLine(string data)
Sends text with a CRLF at the end (used for sending individual lines of text)
Parameters:
data
- public void SendSection(byte[] data)
Sends byte data
Parameters:
data
- DataSystem.InvalidOperationException
- A section has not been startedpublic void SendSection(string data)
Sends string data
Parameters:
data
- DataSystem.InvalidOperationException
- A section has not been startedpublic void SendSection(byte[] data, int length)
Sends data
Parameters:
data
- Datalength
- LengthSystem.InvalidOperationException
- A section has not been startedpublic void StartSection()
Starts a section of unknown size
Throws:
ClintHeyer.Httpd.ConnectionClosedException
- Connection is closedpublic void StartSection(long knownSize)
Starts a section of known size
Parameters:
knownSize
- Size (bytes)ClintHeyer.Httpd.ConnectionClosedException
- Connection is closed
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |