C# Class Whalin.Caching.Memcached.SockIO

Memcached C# memcachedClient, utility class for Socket IO. This class is a wrapper around a Socket and its streams.
Afficher le fichier Open project: xianrendzw/LightFramework.Net Class Usage Examples

Méthodes publiques

Méthode Description
ClearEndOfLine ( ) : void

reads up to end of line and returns nothing

Close ( ) : void

sets closed flag and checks in to connection sockIOPool but does not close connections

Flush ( ) : void

flushes output stream

Read ( byte bytes ) : void

reads length bytes into the passed in byte array from stream

ReadLine ( ) : string

reads a line intentionally not using the deprecated readLine method from DataInputStream

SockIO ( SockIOPool pool, String host, int timeout, int connectTimeout, bool noDelay ) : System

creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams

SockIO ( SockIOPool pool, String host, int port, int timeout, int connectTimeout, bool noDelay ) : System

creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams

ToString ( ) : string

returns the string representation of this socket

TrueClose ( ) : void

closes socket and all streams connected to it

Write ( byte bytes ) : void

writes a byte array to the output stream

Write ( byte bytes, int offset, int count ) : void

writes a byte array to the output stream

Méthodes protégées

Méthode Description
GetSocket ( String host, int port, int timeout ) : Socket

Method which spawns thread to get a connection and then enforces a timeout on the initial connection. This should be backed by a thread sockIOPool. Any volunteers?

Private Methods

Méthode Description
GetLocalizedString ( string key ) : string
SockIO ( ) : System

Method Details

ClearEndOfLine() public méthode

reads up to end of line and returns nothing
public ClearEndOfLine ( ) : void
Résultat void

Close() public méthode

sets closed flag and checks in to connection sockIOPool but does not close connections
public Close ( ) : void
Résultat void

Flush() public méthode

flushes output stream
public Flush ( ) : void
Résultat void

GetSocket() protected static méthode

Method which spawns thread to get a connection and then enforces a timeout on the initial connection. This should be backed by a thread sockIOPool. Any volunteers?
protected static GetSocket ( String host, int port, int timeout ) : Socket
host String host to establish connection to
port int port on that host
timeout int connection timeout in ms
Résultat Socket

Read() public méthode

reads length bytes into the passed in byte array from stream
public Read ( byte bytes ) : void
bytes byte
Résultat void

ReadLine() public méthode

reads a line intentionally not using the deprecated readLine method from DataInputStream
public ReadLine ( ) : string
Résultat string

SockIO() public méthode

creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams
public SockIO ( SockIOPool pool, String host, int timeout, int connectTimeout, bool noDelay ) : System
pool SockIOPool
host String hostname:port
timeout int read timeout value for connected socket
connectTimeout int timeout for initial connections
noDelay bool TCP NODELAY option?
Résultat System

SockIO() public méthode

creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams
public SockIO ( SockIOPool pool, String host, int port, int timeout, int connectTimeout, bool noDelay ) : System
pool SockIOPool
host String host to connect to
port int port to connect to
timeout int int ms to block on data for read
connectTimeout int timeout (in ms) for initial connection
noDelay bool TCP NODELAY option?
Résultat System

ToString() public méthode

returns the string representation of this socket
public ToString ( ) : string
Résultat string

TrueClose() public méthode

closes socket and all streams connected to it
public TrueClose ( ) : void
Résultat void

Write() public méthode

writes a byte array to the output stream
public Write ( byte bytes ) : void
bytes byte byte array to write
Résultat void

Write() public méthode

writes a byte array to the output stream
public Write ( byte bytes, int offset, int count ) : void
bytes byte byte array to write
offset int offset to begin writing from
count int count of bytes to write
Résultat void