Skip to content

Need to be able to listen to all "other" events  #243

Closed

Description

@chenjianjx

After a series of "on event_a", "on event_b", I need to listen to other events that have not been defined by my code.

This is very important for troubleshooting. Sometimes I expect the server side to send me an event but it sends me another event which I haven't listened to. I don't know what this event is because I can't listened to unexpected "other" events.

Activity

  1. nkzawa commented on Nov 9, 2015

    @nkzawa
    Contributor

    Unfortunately, there is no way to do that for now. Basically, you need to know what kind of events server sends.

  2. chenjianjx commented on Nov 10, 2015

    @chenjianjx
    Author

    Yes, there is. Other socket.io java clients can do that. Can you seriously try it?

  3. nkzawa commented on Nov 11, 2015

    @nkzawa
    Contributor

    What I meant is this library doesn't support "oher" events. And I have no though to do so for now since JS client also doesn't.
    Can you propose this as an issue of socketio/socket.io-client if you really think we should have the feature?

  4. Aksi0m commented on May 24, 2016

    @Aksi0m

    I am also in need for a feature like that!

  5. Raduzz commented on Dec 26, 2017

    @Raduzz

    Yes. I need to listen all events as well.
    There is a working solution for JavaScript socket-io-client-respond-to-all-events-with-one-handler (second answer).
    I see there is a custom decoder in socket.io-client-java from version 1.0.0. Is this a way? There is included test in repository but I can not figure out how to use it.

  6. pauljackals commented on Apr 19, 2022

    @pauljackals

    Hi, JS client has .onAny() now, maybe you'll reconsider adding something like that? 🙂

  7. rezafaraji93 commented on May 26, 2022

    @rezafaraji93

    I really this onAny too!

  8. darrachequesne commented on Jul 10, 2022

    @darrachequesne
    Member

    Here we go:

    socket.onAnyIncoming(new Emitter.Listener() {
        @OverRide
        public void call(Object... args) {
            // ...
        }
    });

    Included in version 2.1.0

  9. added this to the 2.1.0 milestone on Jul 10, 2022
  10. irshadir7 commented on Dec 7, 2022

    @irshadir7

    is it possible to track all possible events by using 1x version? because the latest version is not able to connect to the server due to incompatibility . can i achive onAnyIncoming in version 1.0.1

  11. darrachequesne commented on Dec 7, 2022

    @darrachequesne
    Member

    @irshadir7 hi! I will backport the changes in the 1.x branch, let me check.

  12. irshadir7 commented on Dec 7, 2022

    @irshadir7
  13. irshadir7 commented on Dec 8, 2022

    @irshadir7
  14. added a commit that references this issue on Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions