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
[legend]

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
 

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 
)
inline

RedisClientBase constructor.

Parameters
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)
inline

Connects to the Redis server.

Parameters
connectCallbackDelegate called when the socket establishes a connection to the server.
bool Connected ( )
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.

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

Closes the current connection.

Parameters
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)
inlineprotectedvirtual

Callback used in calls to Socket.BeginConnect().

Reimplemented in CommandClient, and SubscriptionClient.

virtual void OnDisconnect ( IAsyncResult  disconnectResult)
inlineprotectedvirtual

Callback used in calls to Socket.BeginDisconnect().

Member Data Documentation

string hostname
protected

Interal copy of the hostname.

int port
protected

Interal copy of the port.

Socket socket
protected

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: