TCP Server Receive
ActionStep Reference » Windows » Network » TCP » TCP Server Receive
The TCP Server Receive ActionStep is designed to be called within a loop to efficiently accept data from connected TCP clients. 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 Server Receive ActionStep.
Parameters:
The ActionStep has the following input parameters:
name |
Description
|
---|---|
Name
|
The name of the TCP server.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Results:
The ActionStep returns the following results:
name
|
description
|
---|---|
Message Count
|
The number of received messages from clients.
Allowed Context Scope [Fixed] Allowed Context Types [Variable, Parameter] |
Messages
|
The data that was received from the connected TCP clients.
Parameter for the "Message" sub-branch:
Allowed Context Types [Variable, Parameter] |
Example 1 (Accept message from a TCP client device):
This example creates two local variables, ServerName and ServerPassword, with Text as data type and values are used to start a TCP server. The server waits for 10 seconds before receiving the message sent by the TCP Client and replies a message back to the client. A notice of the message sent by the TCP client is displayed via Message Box.