fix: emit a CONNECT_ERROR event upon connection failure

See also: 53c73749a8
This commit is contained in:
Damien Arrachequesne
2021-04-27 00:08:16 +02:00
parent e8ffe9d138
commit d324e7f396

View File

@@ -91,8 +91,10 @@ public class Socket extends Emitter {
add(On.on(io, Manager.EVENT_ERROR, new Listener() {
@Override
public void call(Object... args) {
if (!Socket.this.connected) {
Socket.super.emit(EVENT_CONNECT_ERROR, args[0]);
}
}
}));
add(On.on(io, Manager.EVENT_CLOSE, new Listener() {
@Override