C# Class Renci.SshNet.Abstractions.SocketAbstraction

Afficher le fichier Open project: sshnet/SSH.NET

Méthodes publiques

Méthode 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

Méthode Description
ConnectCompleted ( object sender, SocketAsyncEventArgs e ) : void
ReceiveCompleted ( object sender, SocketAsyncEventArgs e ) : void
SendCompleted ( object sender, SocketAsyncEventArgs e ) : void

Method Details

CanRead() public static méthode

public static CanRead ( Socket socket ) : bool
socket Socket
Résultat bool

CanWrite() public static méthode

public static CanWrite ( Socket socket ) : bool
socket Socket
Résultat bool

ClearReadBuffer() public static méthode

public static ClearReadBuffer ( Socket socket ) : void
socket Socket
Résultat void

Connect() public static méthode

public static Connect ( IPEndPoint remoteEndpoint, System.TimeSpan connectTimeout ) : Socket
remoteEndpoint System.Net.IPEndPoint
connectTimeout System.TimeSpan
Résultat Socket

IsErrorResumable() public static méthode

public static IsErrorResumable ( SocketError socketError ) : bool
socketError SocketError
Résultat bool

Read() public static méthode

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.
Résultat int

ReadByte() public static méthode

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.
Résultat int

ReadContinuous() public static méthode

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

ReadPartial() public static méthode

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
Résultat int

Send() public static méthode

public static Send ( Socket socket, byte data ) : void
socket Socket
data byte
Résultat void

Send() public static méthode

public static Send ( Socket socket, byte data, int offset, int size ) : void
socket Socket
data byte
offset int
size int
Résultat void

SendByte() public static méthode

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.
Résultat void