TCP Client Receive
ActionStep Reference » Windows » Network » TCP » TCP Client Receive
The TCP Client Receive ActionStep is designed to be called within a loop to efficiently accept data from a connected TCP server. It collects all data received since the last call, storing the results in a list that can be iterated over, thereby facilitating structured data retrieval and management.
- Open the Windows node in the Workspace Explorer.
- Open the Network node.
- In the TCP node, select the TCP Client Receive ActionStep.
Parameters:
The ActionStep has the following input parameters:
name |
Description
|
---|---|
Name
|
The name of the TCP client.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Results:
The ActionStep returns the following results:
name
|
description
|
---|---|
String Count
|
The number of received string messages.
Allowed Context Scope [Fixed] Allowed Context Types [Variable, Parameter] |
File Count
|
The number of received files.
Allowed Context Scope [Fixed] Allowed Context Types [Variable, Parameter] |
Strings
|
The data that was received from the connected TCP clients.
Parameter for the "String" sub-branch:
Allowed Context Types [Variable, Parameter] |
Files
|
The number of received files.
Parameter for the "File" sub-branch:
Allowed Context Types [Variable, Parameter] |
Example 1 (Store a file received from the TCP server):
This example creates two local variables, ServerName and ServerPassword, with Text as data type. The started client sends a message to the server and waits for its response. If the server responds and the file count is greater or equal to 1, the file from the server is copied and saved in local storage specified in the created path. A notice then displays the location of the stored file in Message Box. Otherwise, the client continues to wait for the server's response.