Closed XiXiongMaoXiong closed 3 years ago
Hi! Those events were not removed per se, they are not forwarded by the Socket instance anymore, but they are still emitted by the underlying Manager.
Before:
socket.on(Socket.EVENT_RECONNECT_ATTEMPT, new Emitter.Listener() {
@Override
public void call(Object... objects) {
// ...
}
});
After:
socket.io().on(Manager.EVENT_RECONNECT_ATTEMPT, new Emitter.Listener() {
@Override
public void call(Object... objects) {
// ...
}
});
The reason behind this change was to make the existence of the Manager explicit for the end users, and to fix some surprising behavior, like:
socket.on(Socket.EVENT_RECONNECT, new Emitter.Listener() {
@Override
public void call(Object... args) {
System.out.println(socket.connected()); // false ???
}
});
Hi! Those events were not removed per se, they are not forwarded by the Socket instance anymore, but they are still emitted by the underlying Manager.
Before:
socket.on(Socket.EVENT_RECONNECT_ATTEMPT, new Emitter.Listener() { @Override public void call(Object... objects) { // ... } });
After:
socket.io().on(Manager.EVENT_RECONNECT_ATTEMPT, new Emitter.Listener() { @Override public void call(Object... objects) { // ... } });
The reason behind this change was to make the existence of the Manager explicit for the end users, and to fix some surprising behavior, like:
socket.on(Socket.EVENT_RECONNECT, new Emitter.Listener() { @Override public void call(Object... args) { System.out.println(socket.connected()); // false ??? } });
Thanks for clarifying mate, I appreciate your work.
Keep it up 👍
Thanks! And EVENT_CONNECT_TIMEOUT
disappeared.
@NotNotMarshall thanks for the kind words :+1:
@CoolMind good catch, I've added it here: https://socketio.github.io/socket.io-client-java/migrating_from_1_x.html#The_Socket_instance_will_no_longer_forward_the_events_emitted_by_its_Manager
Thanks! And
EVENT_CONNECT_TIMEOUT
disappeared.
EVENT_RECONNECTING
and EVENT_CONNECTING
are also not found.
EVENT_RECONNECT_ERROR? EVENT_CONNECTING? EVENT_CONNECT_TIMEOUT? and etc...
I was wondering why you removed these EVENTS, these are so important for some if not all.