An class to simplify a TCP/IP client-side socket.
More...
|
| | Tcp_Client () |
| | Constructor for the Tcp_Client. More...
|
| |
| Int32 | Open (String sHost, Int32 i32Port, Int32 i32TimeoutMs) |
| | Connect to a TCP/IPv4 Server. (Blocked version with timeout) More...
|
| |
| Int32 | Open6 (String sHost, Int32 i32Port, Int32 i32TimeoutMs) |
| | Connect to a TCP/IPv6 Server. (Blocked version with timeout) More...
|
| |
| Boolean | IsOpen () |
| | Tests to see if the socket is writeable. Does not mean the network is available to transmit. More...
|
| |
| Int32 | Close () |
| | Close the TCP/IP connection. More...
|
| |
| Int32 | Receive (Byte[] byary, Int32 i32Timeout_Ms) |
| | Receive data from the TCP/IP connection. More...
|
| |
| Int32 | Receive (Byte[] byary, Int32 i32Offset, Int32 i32MaxSize, Int32 i32TimeoutMs) |
| | Receive data from the TCP/IP connection and store to a particular section of the byte array. More...
|
| |
| Int32 | Send (Byte[] byary, Int32 i32Tx_Length) |
| | Send data to TCP/IP remote host. More...
|
| |
An class to simplify a TCP/IP client-side socket.
Exposed to help users of SNAP-PAC Serial Modules. Property Socket.NoDelay is set to true to provide as responsive data transmission as possible.
| Opto22.Ip4.Tcp_Client.Tcp_Client |
( |
| ) |
|
| Int32 Opto22.Ip4.Tcp_Client.Close |
( |
| ) |
|
Close the TCP/IP connection.
- Returns
- -1 if a fault occured. The object is still closed if -1 returns. Check strLastFault for message.
| Boolean Opto22.Ip4.Tcp_Client.IsOpen |
( |
| ) |
|
Tests to see if the socket is writeable. Does not mean the network is available to transmit.
Please see the internet for additional information for half-open TCP sessions.
Valid half-open TCP sockets will appear writeable. This function only tests to see if the socket appears if data may be sent and after the "connect" has been validated and completed.
- Returns
- True if the socket is open and appears writeable. False otherwise.
| Int32 Opto22.Ip4.Tcp_Client.Open |
( |
String |
sHost, |
|
|
Int32 |
i32Port, |
|
|
Int32 |
i32TimeoutMs |
|
) |
| |
Connect to a TCP/IPv4 Server. (Blocked version with timeout)
- Parameters
-
| sHost | Host name in name or dot IP Address format. |
| i32Port | TCP/IP server port to connect too. |
| i32TimeoutMs | Timeout is Milliseconds to wait for the connection to complete. |
- Returns
- 0 indicates success, -1 indicates failure
| Int32 Opto22.Ip4.Tcp_Client.Open6 |
( |
String |
sHost, |
|
|
Int32 |
i32Port, |
|
|
Int32 |
i32TimeoutMs |
|
) |
| |
Connect to a TCP/IPv6 Server. (Blocked version with timeout)
- Parameters
-
| sHost | Host name in name or dot IP Address format. |
| i32Port | TCP/IP server port to connect too. |
| i32TimeoutMs | Timeout is Milliseconds to wait for the connection to complete. |
- Returns
- 0 indicates success, -1 indicates failure
| Int32 Opto22.Ip4.Tcp_Client.Receive |
( |
Byte[] |
byary, |
|
|
Int32 |
i32Timeout_Ms |
|
) |
| |
Receive data from the TCP/IP connection.
- Parameters
-
| byary | Byte array to store the received data. |
| i32Timeout_Ms | Timeout interval in milliseconds. |
- Returns
- Positive values for data received, zero for timeout. When receiving a negative value, close the socket.
| Int32 Opto22.Ip4.Tcp_Client.Receive |
( |
Byte[] |
byary, |
|
|
Int32 |
i32Offset, |
|
|
Int32 |
i32MaxSize, |
|
|
Int32 |
i32TimeoutMs |
|
) |
| |
Receive data from the TCP/IP connection and store to a particular section of the byte array.
- Parameters
-
| byary | Byte array to store the received data. |
| i32Offset | Offset in the buffer to begin receiving data. |
| i32MaxSize | The maximum receive size to byary. Allows receives smaller than byary. |
| i32TimeoutMs | Timeout interval in milliseconds. |
- Returns
- Positive values for data received, zero for timeout. When receiving a negative value, close the socket.
| Int32 Opto22.Ip4.Tcp_Client.Send |
( |
Byte[] |
byary, |
|
|
Int32 |
i32Tx_Length |
|
) |
| |
Send data to TCP/IP remote host.
- Parameters
-
| byary | Bytes to send. Should at least be i32Tx_Length. |
| i32Tx_Length | Number of bytes to send. |
- Returns
- 0 indicates success, if -1 returned, close the TCP/IP connection.
| String Opto22.Ip4.Tcp_Client.strError = "" |
Last Exception Thrown (when -1 is returned).
The documentation for this class was generated from the following file: