Method | Description | |
---|---|---|
Close ( ) : void |
Close connection
|
|
Dispose ( ) : void |
Implements IDisposable.
|
|
PlainSocket ( |
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
|
Method | Description | |
---|---|---|
DoClose ( ) : void | ||
FireOnClosed ( ) : void |
Call OnClosed() callback
|
|
ReceivingThread ( ) : void |
Receiving thread
|
public PlainSocket ( |
||
socket | socket object (must be already connected) | |
handler | IDataHandler | callback handler (can be null if no handler is specified) |
return | System |
public ReadIfAvailable ( byte buf ) : int | ||
buf | byte | byte array to store data in. |
return | int |
public SetHandler ( IDataHandler handler ) : void | ||
handler | IDataHandler | handler |
return | void |
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 |
return | void |