connectionFailed event type on transport error and possibility to disable autoreconnect

Hello again!
This patch makes it much easier to use this library as subproject and to control reconnection from outer space grouping connections of other subcomponents.