Creating structs for a request object and a response object means that data can live within the Conn.
This should allow the removal of all transient data from the network read/write functions, making everything cleaner.
It also means that ConnRead no longer has to return a mystifying collection of things; it will simply update the Conn's Resp and return nothing but an err. And that err won't be overloaded with app-level information on the status of the request; it will only indicate whether there was an error with the read or not. Request status will be in the request struct.
Creating structs for a request object and a response object means that data can live within the
Conn
.This should allow the removal of all transient data from the network read/write functions, making everything cleaner.
It also means that
ConnRead
no longer has to return a mystifying collection of things; it will simply update theConn
'sResp
and return nothing but anerr
. And thaterr
won't be overloaded with app-level information on the status of the request; it will only indicate whether there was an error with the read or not. Request status will be in the request struct.