Phants Client for Redis™*
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Events | List of all members
RedisClientBase Class Reference
Inheritance diagram for RedisClientBase:
Inheritance graph

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


ConnectedEventHandler connected
DisconnectedEventHandler disconnected

Detailed Description

Serves as the base class for all Redis client implementations. Common socket connect/disconnect code lives here.

Constructor & Destructor Documentation

RedisClientBase ( string  hostname,
int  port 

RedisClientBase constructor.

hostnameThe hostname or IP of a Redis server to connect to.
portThe port to connect to; Redis servers listen on 6379 by default.

Member Function Documentation

void Connect ( ConnectionCallback  connectCallback = null)

Connects to the Redis server.

connectCallbackDelegate called when the socket establishes a connection to the server.
bool Connected ( )

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.

clientThe client object to which the callback pertains.
errorA string indicating any errors that occurred with the connection.
void Disconnect ( ConnectionCallback  disconnectCallback = null)

Closes the current connection.

disconnectCallbackDelegate called when the client disconnects from the server.
delegate void DisconnectedEventHandler ( RedisClientBase  client)

Callback type for socket disconnected events.

virtual void OnConnect ( IAsyncResult  connectResult)

Callback used in calls to Socket.BeginConnect().

Reimplemented in CommandClient, and SubscriptionClient.

virtual void OnDisconnect ( IAsyncResult  disconnectResult)

Callback used in calls to Socket.BeginDisconnect().

Member Data Documentation

string hostname

Interal copy of the hostname.

int port

Interal copy of the port.

Socket socket

The socket used to connect to the server.

Event Documentation

Event type for receiving socket connected events.

Event type for receiving socket disconnected events.

The documentation for this class was generated from the following file: