swift-nio/Sources/NIOHTTP1Client
Liam Flynn 3395d39731 Reorder ‘channel active’ calls to the same order as `_ChannelInboundHandler` and their likely chronological order. (#953)
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.
2019-04-08 22:56:52 +01:00
..
README.md Add a HTTP1 client example. It is only a simple echo which closely resembles the TCP and UDP echo examples. (#941) 2019-04-05 17:38:34 +01:00
main.swift Reorder ‘channel active’ calls to the same order as `_ChannelInboundHandler` and their likely chronological order. (#953) 2019-04-08 22:56:52 +01:00

README.md

NIOHTTP1Client

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

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