Skip to content
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

receive bytebuffer with WebSocketClient #369

Closed
sebaber opened this issue Feb 4, 2016 · 6 comments
Closed

receive bytebuffer with WebSocketClient #369

sebaber opened this issue Feb 4, 2016 · 6 comments

Comments

@sebaber
Copy link

sebaber commented Feb 4, 2016

Hi i have a problem with WebSocketClient class, when i want to change the receive type, the onMessage only accepts String, there is a way to change the type to bytebuffer? or have the two alternatives together?

public class MyWebSocketClient extends WebSocketClient {

    public MyWebSocketClient(URI serverURI) {
    super(serverURI);
}

   // Here i want to receive Bytebuffer not string
@Override
public void onMessage(String message) {
    }

}

@andiwand
Copy link

andiwand commented Jun 4, 2016

overwrite the public void onMessage(ByteBuffer bytes) method?

@kishordesai
Copy link

Override onMessage() method like this. It's working for me.
@OverRide
public void onMessage(WebSocket conn, ByteBuffer buff)

@marci4
Copy link
Collaborator

marci4 commented Mar 20, 2017

Issue answered. closing

Greetings
marci4

@marci4 marci4 closed this as completed Mar 20, 2017
@amirreza-sobhdel
Copy link

Override onMessage() method like this. It's working for me.
@OverRide
public void onMessage(WebSocket conn, ByteBuffer buff)

nah it didnt work , still have to implenment onMessage(String string)

@NoahAndrews
Copy link
Contributor

nah it didnt work , still have to implenment onMessage(String string)

Just implement it as an empty function if you want to ignore all String messages.

@amirreza-sobhdel
Copy link

amirreza-sobhdel commented Feb 14, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants