OptoMMP2
ip4.Udp_Client Class Reference

UDP/IP Client More...

Public Member Functions

int Open6 (string sHost, int iPort)
 Open a UDP/IPV6 client object. More...
 
int Open (string sHost, int iPort)
 Open a UDP/IP client object. More...
 
bool IsOpen ()
 Tests to see if the socket has been opened, that open was called on this object. More...
 
void Close ()
 Close the UDP/IP client object. More...
 
int Receive (byte[] byary, int i32Timeout_Ms)
 Receive data from the UDP/IP client object. More...
 
int Receive (byte[] byary, int iOffset, int iMaxSize, int i32Timeout_Ms)
 Receive data from the UDP/IP client socket and specified which portion of the array to populate. More...
 
int Send (byte[] byary, int i32Tx_Length)
 Send data to the UDP/IP server. More...
 

Detailed Description

UDP/IP Client

Member Function Documentation

void ip4.Udp_Client.Close ( )

Close the UDP/IP client object.

bool ip4.Udp_Client.IsOpen ( )

Tests to see if the socket has been opened, that open was called on this object.

For UDP sockets, there is no connection so after the Open is called, it "always" appears connected.

Returns
True if the socket is open. False otherwise.
int ip4.Udp_Client.Open ( string  sHost,
int  iPort 
)

Open a UDP/IP client object.

Parameters
sHostString of the Host's name or IP address in dot format.
iPortThe UDP port number of the remote host.
Returns
int ip4.Udp_Client.Open6 ( string  sHost,
int  iPort 
)

Open a UDP/IPV6 client object.

Parameters
sHostString of the Host's name or IP address in dot format.
iPortThe UDP port number of the remote host.
Returns
int ip4.Udp_Client.Receive ( byte[]  byary,
int  i32Timeout_Ms 
)

Receive data from the UDP/IP client object.

Parameters
byaryByte array to store data
i32Timeout_MsTimeout in Milliseconds to Wait
Returns
Greater than zero indicates bytes received, zero indicates timeout, -1 is a fault.
int ip4.Udp_Client.Receive ( byte[]  byary,
int  iOffset,
int  iMaxSize,
int  i32Timeout_Ms 
)

Receive data from the UDP/IP client socket and specified which portion of the array to populate.

Parameters
byaryByte array to store received data.
iOffsetOffset in the array to start receiving data.
iMaxSizeMaximum size to receive.
i32Timeout_MsTimeout to implement data.
Returns
Positive value indicate data returned, 0 is timeout, -1 is a communication fault.
int ip4.Udp_Client.Send ( byte[]  byary,
int  i32Tx_Length 
)

Send data to the UDP/IP server.

Parameters
byaryBytes to send, at least i32Tx_Length in length.
i32Tx_LengthNumber of bytes to send.
Returns
0 if successful, -1 if there is a socket error.

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