Rather than having the user of the websocket class be responsible for the creation and management of the weboscket's io and SSL contexts this responsibility should be delegated to the websocket, with the behavior of the instantiating object (for our purposes this will be a QueryService instance) being driven primarily on the basis of events arising from the websocket.
Implementation
This aught to be fairly straight forward:
Remove both ioc and ctx from the constructor signature and have them initialized as part of the initializer list or in the constructor body.
Modify ws::Websocket::run() so that it also executes _ioc.run
Modify unit tests to accomidate for these changes
Modify any other usage of the websocket to accomidate for the new interface and mode of operation
Overview
Rather than having the user of the websocket class be responsible for the creation and management of the weboscket's io and SSL contexts this responsibility should be delegated to the websocket, with the behavior of the instantiating object (for our purposes this will be a QueryService instance) being driven primarily on the basis of events arising from the websocket.
Implementation
This aught to be fairly straight forward:
ioc
andctx
from the constructor signature and have them initialized as part of the initializer list or in the constructor body.ws::Websocket::run()
so that it also executes_ioc.run