Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: socketio/socket.io-client-java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: socketio/socket.io-client-java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 17, 2021

  1. fix: fix emitting of events received during connection establishment (#…

    …695)
    
    Previously, the event name of packets received during the connection
    handshake would not be removed from the arguments array:
    
    ```java
    socket.on("my-event", new Emitter.Listener() {
        @OverRide
        public void call(Object... args) {
            System.out.println(Arrays.toString(args)); // prints ["my-event", "arg1", "arg2", "arg3"]
        }
    });
    ```
    yifucc authored Dec 17, 2021
    Copy the full SHA
    832a609 View commit details
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/main/java/io/socket/client/Socket.java
5 changes: 4 additions & 1 deletion src/main/java/io/socket/client/Socket.java
Original file line number Diff line number Diff line change
@@ -376,7 +376,10 @@ private void onconnect(String id) {
private void emitBuffered() {
List<Object> data;
while ((data = this.receiveBuffer.poll()) != null) {
String event = (String)data.get(0);
if (data.isEmpty()) {
continue;
}
String event = data.remove(0).toString();
super.emit(event, data.toArray());
}
this.receiveBuffer.clear();