Helper Class Reference  1.1
HomeGenie - Automation Programs' Engine SDK
Public Member Functions | Properties | List of all members
UdpClientHelper Class Reference

UDP client helper.
Class instance accessor: UdpClient More...

Public Member Functions

UdpClientHelper Sender (string address, int port)
 Sets the client as a sender to address:port More...
 
bool Receiver (int port)
 Connect to the remote using the specified port. More...
 
UdpClientHelper 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...
 
UdpClientHelper OnStringReceived (Action< string > receivedAction)
 Sets the function to call when a new string message is received. More...
 
UdpClientHelper OnMessageReceived (Action< byte[]> receivedAction)
 Sets the function to call when a new raw message is received. More...
 
UdpClientHelper 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...
 

Detailed Description

UDP client helper.
Class instance accessor: UdpClient

Member Function Documentation

UdpClientHelper Sender ( string  address,
int  port 
)

Sets the client as a sender to address:port

Returns
UdpClientHelper.
Parameters
addressRemote DNS or IP address.
portport to send to
bool Receiver ( int  port)

Connect to the remote using the specified port.

Parameters
portPort number.
UdpClientHelper Disconnect ( )

Disconnects from the remote host.

void SendMessage ( string  message)

Sends a string message.

Parameters
messageMessage.
void SendMessage ( byte[]  message)

Sends a raw data message.

Parameters
messageMessage.
UdpClientHelper OnStringReceived ( Action< string >  receivedAction)

Sets the function to call when a new string message is received.

Parameters
receivedActionFunction or inline delegate.
UdpClientHelper OnMessageReceived ( Action< byte[]>  receivedAction)

Sets the function to call when a new raw message is received.

Parameters
receivedActionFunction or inline delegate.
UdpClientHelper OnStatusChanged ( Action< bool >  statusChangeAction)

Sets the function to call when the status of the connection changes.

Parameters
statusChangeActionFunction or inline delegate.

Property Documentation

bool IsConnected
get

Gets a value indicating whether the connection to the service is estabilished.

true if connected; otherwise, false.

string EndOfLine
getset

Gets or sets the end of line delimiter used in text messaging.

The end of line.


The documentation for this class was generated from the following file: