Skip to content

Commit

Permalink
fix: emit a CONNECT_ERROR event upon connection failure
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Apr 26, 2021
1 parent e8ffe9d commit d324e7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/io/socket/client/Socket.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public void call(Object... args) {
add(On.on(io, Manager.EVENT_ERROR, new Listener() {
@Override
public void call(Object... args) {
Socket.super.emit(EVENT_CONNECT_ERROR, args[0]);
if (!Socket.this.connected) {
Socket.super.emit(EVENT_CONNECT_ERROR, args[0]);
}
}
}));
add(On.on(io, Manager.EVENT_CLOSE, new Listener() {
Expand Down

0 comments on commit d324e7f

Please sign in to comment.