Skip to content

No "Socket.onAny(Event)" function in Java #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aqibbangash opened this issue Nov 17, 2017 · 4 comments
Closed

No "Socket.onAny(Event)" function in Java #475

aqibbangash opened this issue Nov 17, 2017 · 4 comments
Milestone

Comments

@aqibbangash
Copy link

Unlike iOS library, I'm unable to find onAny(Event) function in Java Library.

This demands reframing the whole architecture for an app that is supposed to be developed for Android and iOS both.

@Jedidiah
Copy link

@aqibbangash Realise this was a few years ago and might not be relevant anymore but I was just trying to do the same thing and I think what might help you is .on(io.socket.client.Socket.EVENT_MESSAGE, new Emitter.Listener() { ...

@michalmonday
Copy link

Is there any other way to achieve that? I get the following error with solution above:

EVENT_MESSAGE is not public in io.socket.client.Socket; cannot be accessed from outside package

darrachequesne added a commit that referenced this issue Jul 8, 2022
Syntax:

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

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

Related:

- socketio/engine.io-client-java#99
- #243
- #475
@darrachequesne
Copy link
Member

Here we go!

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

Included in version 2.1.0.

@darrachequesne darrachequesne added this to the 2.1.0 milestone Jul 10, 2022
@irshadir7
Copy link

@darrachequesne after updated to 2.1.0 socket is not connecting . getting server error. may i know the reason? kindly help me pls

cedev935 added a commit to cedev935/socket-java that referenced this issue Sep 14, 2023
Syntax:

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

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

Related:

- socketio/engine.io-client-java#99
- socketio/socket.io-client-java#243
- socketio/socket.io-client-java#475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants