![]() Motivation: When first viewing the example classes, coming to the ‘read’ method first, leaves the subject unclear as to what the method is ‘reading’. It is preferable to view something being sent first, and then to view the reading of the response. It also matches the call order against the protocol making it a little easier for those unfamiliar with the protocol to see which methods have been implemented. Modifications: Moved channel active calls to be top of the class. Despite the diff there are no actual code modifications. UDP Client changed to indent using spaces to match rest of project. Incidental change. Result: The examples are slighter clearer to read, particularly for newcomers to swift-no as the calls are in a logical chronological order. |
||
---|---|---|
.. | ||
README.md | ||
main.swift |
README.md
NIOUDPEchoClient
This sample application provides a simple UDP echo client that will send a single line to a UDP echo server and wait for a response. Invoke it using one of the following syntaxes:
swift run NIOUDPEchoClient # Connects to a server on ::1, server UDP port 9999 and listening port 8888.
swift run NIOUDPEchoClient 9899 9888 # Connects to a server on ::1, server UDP port 9899 and listening port 9888
swift run NIOUDPEchoClient echo.example.com 9899 9888 # Connects to a server on echo.example.com:9899 and listens on UDP port 9888