Helper Class Reference
1.1
HomeGenie - Automation Programs' Engine SDK
|
TCP client helper. Class instance accessor: TcpClient More...
Public Member Functions | |
TcpClientHelper | Service (string address) |
Sets the server address to connect to. More... | |
bool | Connect (int port) |
Connect to the server using the specified port. More... | |
TcpClientHelper | Disconnect () |
Disconnects from the remote host. More... | |
void | SendMessage (string message) |
Sends a string message. More... | |
void | SendMessage (byte[] message) |
Sends a raw data message. More... | |
TcpClientHelper | OnStringReceived (Action< string > receivedAction) |
Sets the function to call when a new string message is received. More... | |
TcpClientHelper | OnMessageReceived (Action< byte[]> receivedAction) |
Sets the function to call when a new raw message is received. More... | |
TcpClientHelper | OnStatusChanged (Action< bool > statusChangeAction) |
Sets the function to call when the status of the connection changes. More... | |
Properties | |
bool | IsConnected [get] |
Gets a value indicating whether the connection to the service is estabilished. More... | |
string | EndOfLine [get, set] |
Gets or sets the end of line delimiter used in text messaging. More... | |
TCP client helper. Class instance accessor: TcpClient
TcpClientHelper Service | ( | string | address | ) |
Sets the server address to connect to.
port | Host DNS or IP address. |
bool Connect | ( | int | port | ) |
Connect to the server using the specified port.
port | Port number. |
TcpClientHelper Disconnect | ( | ) |
Disconnects from the remote host.
void SendMessage | ( | string | message | ) |
Sends a string message.
message | Message. |
void SendMessage | ( | byte[] | message | ) |
Sends a raw data message.
message | Message. |
TcpClientHelper OnStringReceived | ( | Action< string > | receivedAction | ) |
Sets the function to call when a new string message is received.
receivedAction | Function or inline delegate. |
TcpClientHelper OnMessageReceived | ( | Action< byte[]> | receivedAction | ) |
Sets the function to call when a new raw message is received.
receivedAction | Function or inline delegate. |
TcpClientHelper OnStatusChanged | ( | Action< bool > | statusChangeAction | ) |
Sets the function to call when the status of the connection changes.
statusChangeAction | Function or inline delegate. |
|
get |
Gets a value indicating whether the connection to the service is estabilished.
true
if connected; otherwise, false
.
|
getset |
Gets or sets the end of line delimiter used in text messaging.
The end of line.