XenoGuard Documentation

TCP Server Send File

Actions » Windows » Network » TCP » TCP Server Send File 

The action TCP Server Send File transmits a file from a TCP server to a specified TCP client over the network.


[-] Hide
  1. Open the Windows node in the Workspace Explorer.
  2. Open the Network node.
  3. In the TCP node, select the TCP Server Send File action.

Parameters:

The action 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]

Address
The IP address of the client in the network.

Default IP address: 127.0.0.1

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Port

The designated port number of the client.

Default port number: 80

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

Path Name
The path name of the file to be sent to the client.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

Example 1 (Transmit a text file to TCP client):

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 receives a message sent by the TCP client after waiting for 10 seconds. The requested text file by the client is then sent by the server after setting the client's IP address and port number. A notice that the server has sent the file is displayed via Message Box.

Example 2 (Send a message and a file to TCP client):

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 then waits for incoming messages from TCP clients. If the Message Count is greater than zero, the server iterates through the list of messages received and sends a reply and a document file to the TCP clients. A notice is displayed via Message Box after successfully sending the message and file.


See other TCP operations: