Home  Contents

TCP Client Example

TCP/IP Application Notes

ABSTRACT

An example that shows how to program a TCP server.

USAGE

To test the example, you need to have a TCP server listening. This can be a PC running the netcat program, or if you feel adventurous, you may run the TCP server example on a second V4 controller.

A windows version of the netcat program is available in the download section (Download netcat). Linux distributions usually offer netcat as an install via their distribution.

Run netcat with the arguments -v -L -p 40404.

SAMPLE PROJECT

There is a sample project that implements a simple TCP client which connects to a server and tries to keep the connection established.

In the main.lua file of the sample application, enter the IP address of the server.

You can view the example main lua file, download example project TCPClient or browse the project contents online.