C# Class MemcachedClientLibrary.PooledSocket

The PooledSocket class encapsulates a socket connection to a specified memcached server. It contains a buffered stream for communication, and methods for sending and retrieving data from the memcached server, as well as general memcached error checking.
Inheritance: IDisposable
Afficher le fichier Open project: noear/Weed3 Class Usage Examples

Méthodes publiques

Свойство Type Description
Created System.DateTime

Méthodes publiques

Méthode Description
Close ( ) : void

This method closes the underlying stream and socket.

Dispose ( ) : void

Disposing of a PooledSocket object in any way causes it to be returned to its SocketPool.

PooledSocket ( SocketPool socketPool, IPEndPoint endPoint, int sendReceiveTimeout ) : System
Read ( byte bytes ) : void

Fills the given byte array with data from the socket.

ReadLine ( ) : string

Reads from the socket until the sequence '\r\n' is encountered, and returns everything up to but not including that sequence as a UTF8-encoded string

ReadResponse ( ) : string

Reads a response line from the socket, checks for general memcached errors, and returns the line. If an error is encountered, this method will throw an exception.

Reset ( ) : bool

Resets this PooledSocket by making sure the incoming buffer of the socket is empty. If there was any leftover data, this method return true.

SkipUntilEndOfLine ( ) : void

Reads from the socket until the sequence '\r\n' is encountered.

Write ( byte bytes ) : void

Writes an array of bytes to the socket and flushes the stream.

Write ( string str ) : void

Writes a string to the socket encoded in UTF8 format.

Method Details

Close() public méthode

This method closes the underlying stream and socket.
public Close ( ) : void
Résultat void

Dispose() public méthode

Disposing of a PooledSocket object in any way causes it to be returned to its SocketPool.
public Dispose ( ) : void
Résultat void

PooledSocket() public méthode

public PooledSocket ( SocketPool socketPool, IPEndPoint endPoint, int sendReceiveTimeout ) : System
socketPool SocketPool
endPoint System.Net.IPEndPoint
sendReceiveTimeout int
Résultat System

Read() public méthode

Fills the given byte array with data from the socket.
public Read ( byte bytes ) : void
bytes byte
Résultat void

ReadLine() public méthode

Reads from the socket until the sequence '\r\n' is encountered, and returns everything up to but not including that sequence as a UTF8-encoded string
public ReadLine ( ) : string
Résultat string

ReadResponse() public méthode

Reads a response line from the socket, checks for general memcached errors, and returns the line. If an error is encountered, this method will throw an exception.
public ReadResponse ( ) : string
Résultat string

Reset() public méthode

Resets this PooledSocket by making sure the incoming buffer of the socket is empty. If there was any leftover data, this method return true.
public Reset ( ) : bool
Résultat bool

SkipUntilEndOfLine() public méthode

Reads from the socket until the sequence '\r\n' is encountered.
public SkipUntilEndOfLine ( ) : void
Résultat void

Write() public méthode

Writes an array of bytes to the socket and flushes the stream.
public Write ( byte bytes ) : void
bytes byte
Résultat void

Write() public méthode

Writes a string to the socket encoded in UTF8 format.
public Write ( string str ) : void
str string
Résultat void

Property Details

Created public_oe property

public DateTime,System Created
Résultat System.DateTime