|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
A implementation that uses .NET asynchronous I/O. Use with a
Field Summary | |
---|---|
string | basicStringRep |
byte[] | buffer |
string | cachedRemoteIp |
long | lastAction |
long | lastTransferRate |
ClintHeyer.Httpd.ServerManager | manager |
byte[] | readBuffer |
ClintHeyer.Httpd.HttpSession | session |
System.Net.Sockets.Socket | socket |
string | stringRep |
ClintHeyer.Httpd.Throttler | throttledStream |
long | transferStart |
long | transferTotal |
Constructor Summary | |
---|---|
ConnectionAsync(ClintHeyer.Httpd.ServerManager manager, System.Net.Sockets.Socket socket) Constructor |
Property Summary | |
---|---|
ClintHeyer.Httpd.HttpSession |
Session
Gets the session for this connection |
long |
TransferRate
Gets the last recorded transfer speed (bytes per second) |
Method Summary | |
---|---|
void | BeginRead() |
void |
Close() Closes a connection, it's socket, and calls ClintHeyer.Httpd.ServerManager.ConnectionClosed(ClintHeyer.Httpd.Connection) on it's server. |
void | CloseImpl() |
bool | GetRecievedData(System.IAsyncResult ar) |
bool |
IsAlive() Manually checks if a connection is still alive. If not, initiates close procedure |
bool |
IsClosed() Is the connection closed? |
bool |
IsExpired() Checks whether connection has expired. If so, triggers closed procedures |
void | OnRecievedData(System.IAsyncResult ar) |
void |
OnSendComplete(System.IAsyncResult result) Notification that send has completed |
string |
RemoteHostname() Gets the remote hostname of the client |
string |
RemoteIP() Does a reverse lookup on hostname to get IP address (cached) |
void |
SendData(byte[] data, int length, long throttleRate) Sends data to a connection |
void |
SetSession(ClintHeyer.Httpd.HttpSession session) Sets the session for this connection |
string |
ToBasicString() Gets a string representation of connection |
string |
ToString() Returns a string representation of connection |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone |
Field Detail |
---|
private string basicStringRep
private byte[] buffer
private string cachedRemoteIp
private long lastAction
private long lastTransferRate
private ClintHeyer.Httpd.ServerManager manager
private byte[] readBuffer
private ClintHeyer.Httpd.HttpSession session
private System.Net.Sockets.Socket socket
private string stringRep
private ClintHeyer.Httpd.Throttler throttledStream
private long transferStart
private long transferTotal
Constructor Detail |
---|
public ConnectionAsync(ClintHeyer.Httpd.ServerManager manager, System.Net.Sockets.Socket socket)
Constructor
Parameters:
manager
- ServerManager connection belongs toosocket
- Socket that connection usesProperty Detail |
---|
public ClintHeyer.Httpd.HttpSession Session
Gets the session for this connection
public long TransferRate
Gets the last recorded transfer speed (bytes per second)
Method Detail |
---|
private void BeginRead()
public void Close()
Closes a connection, it's socket, and calls ClintHeyer.Httpd.ServerManager.ConnectionClosed(ClintHeyer.Httpd.Connection) on it's server.
private void CloseImpl()
private bool GetRecievedData(System.IAsyncResult ar)
public bool IsAlive()
Manually checks if a connection is still alive. If not, initiates close procedure
Returns:
public bool IsClosed()
Is the connection closed?
Returns:
public bool IsExpired()
Checks whether connection has expired. If so, triggers closed procedures
Returns:
private void OnRecievedData(System.IAsyncResult ar)
public void OnSendComplete(System.IAsyncResult result)
Notification that send has completed
Parameters:
result
- public string RemoteHostname()
Gets the remote hostname of the client
Returns:
public string RemoteIP()
Does a reverse lookup on hostname to get IP address (cached)
Returns:
public void SendData(byte[] data, int length, long throttleRate)
Sends data to a connection
Parameters:
data
- Datalength
- LengththrottleRate
- Throttle rate. Use a number less than zero for no throttlingClintHeyer.Httpd.ConnectionClosedException
- Connection has been closedpublic void SetSession(ClintHeyer.Httpd.HttpSession session)
Sets the session for this connection
Parameters:
session
- Sessionpublic string ToBasicString()
Gets a string representation of connection
Returns:
public string ToString()
Returns a string representation of connection
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 |