mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
* 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
304 B
304 B
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.