Better handling of connect errors, support for (manual) reconnection