Skip to content

Commit d324e7f

Browse files
fix: emit a CONNECT_ERROR event upon connection failure
See also: socketio/socket.io-client@53c7374
1 parent e8ffe9d commit d324e7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/main/java/io/socket/client/Socket.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public void call(Object... args) {
9191
add(On.on(io, Manager.EVENT_ERROR, new Listener() {
9292
@Override
9393
public void call(Object... args) {
94-
Socket.super.emit(EVENT_CONNECT_ERROR, args[0]);
94+
if (!Socket.this.connected) {
95+
Socket.super.emit(EVENT_CONNECT_ERROR, args[0]);
96+
}
9597
}
9698
}));
9799
add(On.on(io, Manager.EVENT_CLOSE, new Listener() {

0 commit comments

Comments
 (0)