Simple TCP/IP echo client

This program demonstrates a simple TCP/IP client. It will connect to an echo server and echo a string the user types.

Programming Issues

This program illustrates the classic process for a TCP/IP client program. Summarised, it is as follows:

Usage

Launch a server process in the background (or find one already running) and run the program to connect to it:

[paul@localhost paul]$ ./echoserv 3357 &
[paul@localhost paul]$ ./echoclnt -a 127.0.0.1 -p 3357
Enter the string to echo: Echo me, please.
Echo response: Echo me, please.

[paul@localhost paul]$

Use the -a and -p switches to specify the remote IP address and port of the server.

Source and Downloads