Files
swift-nio/Sources/NIOEchoClient
Matt Eaton 7895bc88fd Enhanced the output of the NIOEchoClient Example (#585)
Motivation:

I was testing the NIOEchoClient example on Linux and noticed that I received no character output.
I thought this would be handy and added this code to do so.

Modifications:

Small modification to the channelRead method in NIOEchoClient to read the bytes and transform to a string.

Result:

The display of the characters on your echo client before the channel closes.
2018-08-20 11:45:16 +01:00
..

NIOEchoClient

This sample application provides a simple echo client that will send a single line to an echo server and wait for a response. Invoke it using one of the following syntaxes:

swift run NIOEchoClient  # Connects to a server on ::1, port 9999.
swift run NIOEchoClient 9899  # Connects to a server on ::1, port 9899
swift run NIOEchoClient /path/to/unix/socket  # Connects to a server using the given UNIX socket
swift run NIOEchoClient echo.example.com 9899  # Connects to a server on echo.example.com:9899