this.onStanzaReceived = new Event<IPacket>("bosh:onReceived");
this.onResponse = new Event<String>("bosh:onResponse");
this.onStanzaSent = new Event<IPacket>("bosh:onSent");
this.errors = 0;
this.listener = new ConnectorCallback() {
public void onError(final String request, final Throwable throwable) {
if (running) {
Logger.debug("Connection error (total: {0}): {1}", errors, throwable);
errors++;