11.2.3.2 Client Class

For a list of all members of this type, see Client Members .

Syntax: Visual Basic

Public MustInherit Class Client

Syntax: C#

public abstract class Client

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: MySql.Data.MySqlClient.Memcached

Assembly: MySql.Data (in MySql.Data.dll)

See Also

Client Members, MySql.Data.MySqlClient.Memcached Namespace

11.2.3.2.1 Client Members

Client overview

Public Static Methods

GetInstanceFactory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitely opened see method Client.Open

Protected Instance Properties

serverThe server DNS or IP address used by the connection.
portThe port used by the connection.
streamThe network stream used by the connecition.

Public Instance Methods

OpenOpens the client connection.
CloseCloses the client connection.
AddAdds a new key/value pair with the given TimeSpan expiration.
AppendAppends the data to the existing data for the associated key..
CasExecutes the Check-and-set Memcached operation.
Decrement>Decrements the value associated with a key by the given amount.
DeleteRemoves they pair key/value given the specified key.
FlushAllRemoves all entries from the storage, effectively invalidating the whole cache.
GetGet the key/value pair associated with a given key.
IncrementIncrements the value associated with a key by the given amount.
PrependPrepends the data to the existing data for the associated key.
ReplaceReplaces the value associated with the given key with another value.
SetSet the value of a given key.

Public Static Methods

GetInstanceFactory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitely opened see method Open.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

11.2.3.2.1.1 server Property

The server DNS or IP address used by the connection.

Syntax: Visual Basic

Protected server As String

Syntax: C#

protected string server

Property Value

The server DNS or IP address used by the connection.

Remarks

None

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

11.2.3.2.1.2 Port Property

The port used by the connection.

Syntax: Visual Basic

Protected port As UInteger

Syntax: C#

protected uint port

Property Value

The TCP port where the Innodb Memcached plugin will be listening for connections.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

11.2.3.2.1.3 stream

The network stream used by the connection.

Syntax: Visual Basic

Protected stream As Stream

Syntax: C#

protected Stream stream;

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

11.2.3.2.1.4 Client.Open Method

Syntax: Visual Basic

Public Overridable Sub Open

Syntax: C#

public virtual void Open();

Opens the client connection.

Remarks

A client object can be opened and closed many times during its life cycle.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

11.2.3.2.1.5 Client.Close Method

Syntax: Visual Basic

Public Overridable Sub Close

Syntax: C#

public virtual void Close();

Closes the client connection.

Remarks

A client object can be opened and closed many times during its life cycle.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

11.2.3.2.1.6 Client.Add Method

Syntax: Visual Basic

Public MustOverride Sub Add ( 
 key As String,
 data As Object,
 expiration As TimeSpan
)

Syntax: C#

public abstract void Add(
 string key,
 Object data,
 TimeSpan expiration
);

Adds a new key/value pair with the given TimeSpan expiration.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to associate with the key.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

11.2.3.2.1.7 Client.Append Method

Syntax: Visual Basic

Public MustOverride Sub Append ( 
 key As String,
 data As Object
)

Syntax: C#

public abstract void Append(
 string key,
 Object data
);

Appends the data to the existing data for the associated key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to append with the data associated with the key.

11.2.3.2.1.8 Client.Cas Method

Syntax: Visual Basic

Public MustOverride Sub Cas ( 
 key As String,
 data As Object,
 expiration As TimeSpan,
 casUnique As ULong
)

Syntax: C#

public abstract void Cas(
 string key,
 Object data,
 TimeSpan expiration,
 ulong casUnique
);

Executes the Check-and-set Memcached operation.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to use in the CAS.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

  • casUnique, The CAS unique value to use.

11.2.3.2.1.9 Client.Decrement Method

Syntax: Visual Basic

Public MustOverride Sub Decrement ( 
 key As String,
 amount As Integer
)

Syntax: C#

public abstract void Decrement(
 string key,
 int amount
);

Decrements the value associated with a key by the given amount.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key associated with the value to decrement.

  • amount, The amount to decrement the value.

11.2.3.2.1.10 Client.Delete Method

Syntax: Visual Basic

Public MustOverride Sub Delete ( 
 key As String
)

Syntax: C#

public abstract void Delete(
 string key
);

Removes they pair key/value given the specified key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key associated with the value to delete.

11.2.3.2.1.11 Client.FlushAll Method

Syntax: Visual Basic

Public MustOverride Sub FlushAll ( 
 delay As TimeSpan
)

Syntax: C#

public abstract void FlushAll(
 TimeSpan delay
);

Removes all entries from the storage, effectively invalidating the whole cache.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • TimeSpan, The interval after which the cache will be cleaned. Can be TimeSpan.Zero for immediately.

11.2.3.2.1.12 Client.Get Method

Syntax: Visual Basic

Public MustOverride Function Get ( 
 key As String
) As KeyValuePair(Of String, Object)

Syntax: C#

public abstract KeyValuePair string, Object> Get(
 string key
);

Get the key/value pair associated with a given key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for which to returm the key/value.

Return Value

The key/value associated with the key or a MemcachedException if it does not exists.

11.2.3.2.1.13 Client.Increment Method

Syntax: Visual Basic

Public MustOverride Sub Increment ( 
 key As String,
 amount As Integer
)

Syntax: C#

public abstract void Increment(
 string key,
 int amount
);

Increments the value associated with a key by the given amount.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key associated with the value to increment.

  • amount, The amount to increment the value.

11.2.3.2.1.14 Client.Prepend Method

Syntax: Visual Basic

Public MustOverride Sub Prepend ( 
 key As String,
 data As Object
)

Syntax: C#

public abstract void Prepend(
 string key,
 Object data
);

Prepends the data to the existing data for the associated key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to append with the data associated with the key.

11.2.3.2.1.15 Client.Replace Method

Syntax: Visual Basic

Public MustOverride Sub Replace ( 
 key As String,
 data As Object,
 expiration As TimeSpan
)

Syntax: C#

public abstract void Replace(
 string key,
 Object data,
 TimeSpan expiration
);

Replaces the value associated with the given key with another value.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to replace the value associated with the key.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

11.2.3.2.1.16 Client.Set Method

Syntax: Visual Basic

Public MustOverride Sub Set ( 
 key As String,
 data As Object,
 expiration As TimeSpan
)

Syntax: C#

public abstract void Set(
 string key,
 Object data,
 TimeSpan expiration
);

Set the value of a given key.

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • key, The key for identifying the entry.

  • data, The data to associate with the given key.

  • expiration, The interval of timespan, use TimeSpan.Zero for no expiration.

11.2.3.2.1.17 Client.GetInstance Method

Syntax: Visual Basic

Public Shared Function GetInstance ( 
 server As String,
 port As UInteger,
 flags As MemcachedFlags
) As Client

Syntax: C#

public static Client GetInstance(
 string server,
 uint port,
 MemcachedFlags flags
);

Factory method for creating instances of Client that implement a connection with the requested features. The connection object returned must be explicitely opened see method Open().

Remarks

None.

See Also

Client Class, MySql.Data.MySqlClient.Memcached Namespace

Parameters

  • server, The Memcached server DNS or IP address.

  • port, The port for the Memcached server.

  • flags, A set of flags indicating characterestics requested.

Return Value

An instance of a client connection ready to be used.


User Comments
Sign Up Login You must be logged in to post a comment.