C# Класс 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.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Created System.DateTime

Открытые методы

Метод Описание
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.

Описание методов

Close() публичный Метод

This method closes the underlying stream and socket.
public Close ( ) : void
Результат void

Dispose() публичный Метод

Disposing of a PooledSocket object in any way causes it to be returned to its SocketPool.
public Dispose ( ) : void
Результат void

PooledSocket() публичный Метод

public PooledSocket ( SocketPool socketPool, IPEndPoint endPoint, int sendReceiveTimeout ) : System
socketPool SocketPool
endPoint System.Net.IPEndPoint
sendReceiveTimeout int
Результат System

Read() публичный Метод

Fills the given byte array with data from the socket.
public Read ( byte bytes ) : void
bytes byte
Результат void

ReadLine() публичный Метод

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
Результат string

ReadResponse() публичный Метод

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
Результат string

Reset() публичный Метод

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
Результат bool

SkipUntilEndOfLine() публичный Метод

Reads from the socket until the sequence '\r\n' is encountered.
public SkipUntilEndOfLine ( ) : void
Результат void

Write() публичный Метод

Writes an array of bytes to the socket and flushes the stream.
public Write ( byte bytes ) : void
bytes byte
Результат void

Write() публичный Метод

Writes a string to the socket encoded in UTF8 format.
public Write ( string str ) : void
str string
Результат void

Описание свойств

Created публичное свойство

public DateTime,System Created
Результат System.DateTime