Fixed unused variable.
Added Connection.on_connect mechanism.