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.
ファイルを表示 Open project: xianrendzw/LightFramework.Net Class Usage Examples

Public Methods

Method 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

Protected Methods

Method 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

Method Description
GetLocalizedString ( string key ) : string
SockIO ( ) : System

Method Details

ClearEndOfLine() public method

reads up to end of line and returns nothing
public ClearEndOfLine ( ) : void
return void

Close() public method

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

Flush() public method

flushes output stream
public Flush ( ) : void
return void

GetSocket() protected static method

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
return Socket

Read() public method

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

ReadLine() public method

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

SockIO() public method

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?
return System

SockIO() public method

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?
return System

ToString() public method

returns the string representation of this socket
public ToString ( ) : string
return string

TrueClose() public method

closes socket and all streams connected to it
public TrueClose ( ) : void
return void

Write() public method

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

Write() public method

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
return void