C# Class Granados.IO.PlainSocket

Inheritance: Granados.IO.AbstractGranadosSocket
Afficher le fichier Open project: poderosaproject/poderosa Class Usage Examples

Méthodes publiques

Méthode Description
Close ( ) : void

Close connection

Dispose ( ) : void

Implements IDisposable.

PlainSocket ( Socket socket, IDataHandler handler ) : System

Constructor

ReadIfAvailable ( byte buf ) : int

Read bytes if any data can be read.

This method fails if asynchronous receiving is already started by RepeatAsyncRead().

RepeatAsyncRead ( ) : void

Start asynchronous receiving cycle.

SetHandler ( IDataHandler handler ) : void

Set callback handler.

Write ( byte data, int offset, int length ) : void

Write data to the socket

Private Methods

Méthode Description
DoClose ( ) : void
FireOnClosed ( ) : void

Call OnClosed() callback

ReceivingThread ( ) : void

Receiving thread

Method Details

Close() public méthode

Close connection
public Close ( ) : void
Résultat void

Dispose() public méthode

Implements IDisposable.
public Dispose ( ) : void
Résultat void

PlainSocket() public méthode

Constructor
public PlainSocket ( Socket socket, IDataHandler handler ) : System
socket System.Net.Sockets.Socket socket object (must be already connected)
handler IDataHandler callback handler (can be null if no handler is specified)
Résultat System

ReadIfAvailable() public méthode

Read bytes if any data can be read.
This method fails if asynchronous receiving is already started by RepeatAsyncRead().
public ReadIfAvailable ( byte buf ) : int
buf byte byte array to store data in.
Résultat int

RepeatAsyncRead() public méthode

Start asynchronous receiving cycle.
public RepeatAsyncRead ( ) : void
Résultat void

SetHandler() public méthode

Set callback handler.
public SetHandler ( IDataHandler handler ) : void
handler IDataHandler handler
Résultat void

Write() public méthode

Write data to the socket
public Write ( byte data, int offset, int length ) : void
data byte byte array that contains data to write
offset int start index of data
length int byte count to write
Résultat void