C# Class Renci.SshNet.Abstractions.SocketAbstraction

ファイルを表示 Open project: sshnet/SSH.NET

Public Methods

Method Description
CanRead ( Socket socket ) : bool
CanWrite ( Socket socket ) : bool
ClearReadBuffer ( Socket socket ) : void
Connect ( IPEndPoint remoteEndpoint, System.TimeSpan connectTimeout ) : Socket
IsErrorResumable ( SocketError socketError ) : bool
Read ( Socket socket, byte buffer, int offset, int size, System.TimeSpan timeout ) : int

Receives data from a bound Socketinto a receive buffer.

If no data is available for reading, the Read(Socket,byte[], int, int, TimeSpan) method will block until data is available or the time-out value was exceeded. If the time-out value was exceeded, the Read(Socket,byte[], int, int, TimeSpan) call will throw a SshOperationTimeoutException. If you are in non-blocking mode, and there is no data available in the in the protocol stack buffer, the Read(Socket,byte[], int, int, TimeSpan) method will complete immediately and throw a SocketException.

ReadByte ( Socket socket, System.TimeSpan timeout ) : int

Reads a byte from the specified Socket.

ReadContinuous ( Socket socket, byte buffer, int offset, int size, Action processReceivedBytesAction ) : void
ReadPartial ( Socket socket, byte buffer, int offset, int size, System.TimeSpan timeout ) : int
Send ( Socket socket, byte data ) : void
Send ( Socket socket, byte data, int offset, int size ) : void
SendByte ( Socket socket, byte value ) : void

Sends a byte using the specified Socket.

Private Methods

Method Description
ConnectCompleted ( object sender, SocketAsyncEventArgs e ) : void
ReceiveCompleted ( object sender, SocketAsyncEventArgs e ) : void
SendCompleted ( object sender, SocketAsyncEventArgs e ) : void

Method Details

CanRead() public static method

public static CanRead ( Socket socket ) : bool
socket Socket
return bool

CanWrite() public static method

public static CanWrite ( Socket socket ) : bool
socket Socket
return bool

ClearReadBuffer() public static method

public static ClearReadBuffer ( Socket socket ) : void
socket Socket
return void

Connect() public static method

public static Connect ( IPEndPoint remoteEndpoint, System.TimeSpan connectTimeout ) : Socket
remoteEndpoint System.Net.IPEndPoint
connectTimeout System.TimeSpan
return Socket

IsErrorResumable() public static method

public static IsErrorResumable ( SocketError socketError ) : bool
socketError SocketError
return bool

Read() public static method

Receives data from a bound Socketinto a receive buffer.
If no data is available for reading, the Read(Socket,byte[], int, int, TimeSpan) method will block until data is available or the time-out value was exceeded. If the time-out value was exceeded, the Read(Socket,byte[], int, int, TimeSpan) call will throw a SshOperationTimeoutException. If you are in non-blocking mode, and there is no data available in the in the protocol stack buffer, the Read(Socket,byte[], int, int, TimeSpan) method will complete immediately and throw a SocketException.
public static Read ( Socket socket, byte buffer, int offset, int size, System.TimeSpan timeout ) : int
socket Socket
buffer byte An array of type that is the storage location for the received data.
offset int The position in parameter to store the received data.
size int The number of bytes to receive.
timeout System.TimeSpan Specifies the amount of time after which the call will time out.
return int

ReadByte() public static method

Reads a byte from the specified Socket.
The read operation timed out. The read failed.
public static ReadByte ( Socket socket, System.TimeSpan timeout ) : int
socket Socket The to read from.
timeout System.TimeSpan Specifies the amount of time after which the call will time out.
return int

ReadContinuous() public static method

public static ReadContinuous ( Socket socket, byte buffer, int offset, int size, Action processReceivedBytesAction ) : void
socket Socket
buffer byte
offset int
size int
processReceivedBytesAction Action
return void

ReadPartial() public static method

public static ReadPartial ( Socket socket, byte buffer, int offset, int size, System.TimeSpan timeout ) : int
socket Socket
buffer byte
offset int
size int
timeout System.TimeSpan
return int

Send() public static method

public static Send ( Socket socket, byte data ) : void
socket Socket
data byte
return void

Send() public static method

public static Send ( Socket socket, byte data, int offset, int size ) : void
socket Socket
data byte
offset int
size int
return void

SendByte() public static method

Sends a byte using the specified Socket.
The write failed.
public static SendByte ( Socket socket, byte value ) : void
socket Socket The to write to.
value byte The value to send.
return void