The client
class in the exemple wraps the whole process:
- The name resolution process
- The connection establishment
- The sending of the request
- The handling of the response
Once you reached EOF
when reading the response, your connection is closed by the server (because of the HTTP Header). Therefor, you have to restart part of the process. You have to first re-establish a connection to the remote server, send your request, and read the response. It's probably not useful to redo name resolution.
If you really want to go the simple way, then creating a new client
would probably work.
You don't need a pool of thread and you can certainly re-use your io_service
object.