public BoshConnection(final Services services) {
this.services = services;
this.onError = new Event<String>("bosh:onError");
this.onDisconnected = new Event<String>("bosh:onDisconnected");
this.onConnected = new Event0("bosh:onConnected");
this.onStanzaReceived = new Event<IPacket>("bosh:onReceived");
this.onResponse = new Event<String>("bosh:onResponse");
this.onStanzaSent = new Event<IPacket>("bosh:onSent");
this.errors = 0;