Phants Client for Redis™*
|
Public Member Functions | |
delegate void | ConnectionCallback (RedisClientBase client, string error) |
delegate void | ConnectedEventHandler (RedisClientBase client) |
delegate void | DisconnectedEventHandler (RedisClientBase client) |
RedisClientBase (string hostname, int port) | |
void | Connect (ConnectionCallback connectCallback=null) |
void | Disconnect (ConnectionCallback disconnectCallback=null) |
bool | Connected () |
Protected Member Functions | |
virtual void | OnConnect (IAsyncResult connectResult) |
virtual void | OnDisconnect (IAsyncResult disconnectResult) |
Protected Attributes | |
string | hostname |
int | port |
Socket | socket |
Events | |
ConnectedEventHandler | connected |
DisconnectedEventHandler | disconnected |
Serves as the base class for all Redis client implementations. Common socket connect/disconnect code lives here.
|
inline |
RedisClientBase constructor.
hostname | The hostname or IP of a Redis server to connect to. |
port | The port to connect to; Redis servers listen on 6379 by default. |
|
inline |
Connects to the Redis server.
connectCallback | Delegate called when the socket establishes a connection to the server. |
|
inline |
Returns the state of the connection.
delegate void ConnectedEventHandler | ( | RedisClientBase | client | ) |
Callback type for socket connected event.
delegate void ConnectionCallback | ( | RedisClientBase | client, |
string | error | ||
) |
Callback type used by Connect() and Disconnect() methods.
client | The client object to which the callback pertains. |
error | A string indicating any errors that occurred with the connection. |
|
inline |
Closes the current connection.
disconnectCallback | Delegate called when the client disconnects from the server. |
delegate void DisconnectedEventHandler | ( | RedisClientBase | client | ) |
Callback type for socket disconnected events.
|
inlineprotectedvirtual |
Callback used in calls to Socket.BeginConnect().
Reimplemented in CommandClient, and SubscriptionClient.
|
inlineprotectedvirtual |
Callback used in calls to Socket.BeginDisconnect().
|
protected |
Interal copy of the hostname.
|
protected |
Interal copy of the port.
|
protected |
The socket used to connect to the server.
ConnectedEventHandler connected |
Event type for receiving socket connected events.
DisconnectedEventHandler disconnected |
Event type for receiving socket disconnected events.