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

Tomcat #312

Closed
Hugolarson opened this issue May 4, 2015 · 2 comments
Closed

Tomcat #312

Hugolarson opened this issue May 4, 2015 · 2 comments
Labels

Comments

@Hugolarson
Copy link

Hello,

Does anybody have problem with using WebSocketClient with Tomcat-7.0.61.

Client Code.

ExampleClient c = new ExampleClient( new URI( "ws:https://localhost:8080/WebSocketProxy/websocket/echoAnnotation"), new Draft_17() );
c.connect();
c.send("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");

onOpen is called and replies.
onMessage is never called whatever i do.

//Server code on Tomcat
@serverendpoint("/websocket/echoAnnotation")
public class EchoAnnotation {
@OnMessage
public void onMessage(Session session, String message ) {
System.out.println( "server received: " + message );
}
@OnMessage
public void onMessage(Session session, ByteBuffer message ) {
System.out.println( "server onMessage bytebuf: ");

    try {
        session.getBasicRemote().sendBinary(message);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
@OnOpen
public void open(Session session) {
    System.out.println("onopen");
    try {
        session.getBasicRemote().sendText("hello from server");
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

}

Thanks,
Hugo

@threat
Copy link

threat commented Jun 19, 2015

Sounds like the socket is being closed right after opening, could be that the client is not compatible with Tomcat... Does the problem occur with a javascript client?

@threat threat added the Unclear label Jun 19, 2015
@marci4
Copy link
Collaborator

marci4 commented Nov 15, 2017

Closing old issue without any clear exception.

Greetings
marci4

@marci4 marci4 closed this as completed Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants