Files
swift-nio/Sources/NIOTCPEchoServer
Franz Busch b25bc5838f Add async TCP echo example (#2463)
* Add async TCP echo example

# Motivation
We introduced new async APIs to our bootstraps that make it easy to use NIO from Swift Concurrency. We should provide examples showing how to use those new APIs. In the future, we want to make those examples the primary ones and remove the non-async based ones.

# Modification
This PR introduces two new targets: `NIOTCPEchoServer` and `NIOTCPEchoClient`. Both targets are executable and provide either the server or client piece of the example.

# Result
New and shiny async example

* Code review

* Adopt NIO singletons

* Review

* George review
2023-07-31 01:53:41 -07:00
..
2023-07-31 01:53:41 -07:00

NIOTCPEchoServer

This sample application provides a simple TCP server that sends clients back whatever they send it.

To run this server execute the following from the root of the repository:

swift run NIOTCPEchoServer

You can then use the NIOTCPClient to send requests to the server.