[feature][fix] improves error handling

It adds ability to reconnect after disconnected. 
It also try to enqueue each message that will be added while being disconnected. 

@errordeveloper We have to discuss the strategy of handling messages while the client stays disconnected.

@Palantir555 @errordeveloper please review the changes and put your questions if you will have any