Hi, I'm having a strange issue:

I'm developing a frontend with WebSockets, (my first WebSocket! ). To test
the code I'm also developing some tests to run in Eclipse.

So, I create a Client in the Test, connect to the server, and want to have
some communication.
I added lot of logs to debug the issue:

- *WebsocketClientEndpoint*:33 - Connect to server
- *WebsocketClientEndpoint*:41 - Before Request: Cookie,
- WebSocketFilter:38 - Filter executing ..
- *WebsocketClientEndpoint*:64 - opening websocket
- WebSocketServer:59 - 1 has opened a connection
- WebSocketServer:64 - clientIP:
- *WebsocketClientEndpoin*t:113 - sendMessage ....
- WebSocketServer:75 - onMessage: .....
- WebSocketServer:117 - Send OK message

At the end, the server sends a response ("OK"), and the client waits for
the response of the server.
But the client doesn't receive it, no mater how long I wait.
I debug the Tomcats code, but couldn't find the issue.
It's not clear for me the point where the library writes the information in
the socket.

This is how I send the response from the server:


  * @OnMessage*
   public void onMessage(String message) {
         // Send OK response
         try {
            logger.debug("Send OK message");
*            session.getBasicRemote().sendText("OK");*
         } catch (IOException e) {

The following is the @OnOpen code:

   public void onOpen(Session session) {

      this.session = session;
      logger.info(session.getId() + " has opened a connection");
      final PrincipalWithRemoteAddress pws = ((PrincipalWithRemoteAddress)
      remoteAdr = pws == null ? null : pws.getRemoteAdr();

      try {
*         session.getBasicRemote().sendText("OK");*
      } catch (IOException e) {

Also the previous "OK" message is not received in the client, I don't see
the log of it in the console:

   public void onMessage(String message) {
      logger.debug("onMessage: " + message);

      if (this.messageHandler != null) {

Any idea why I am having just like half duplex communication ?
Or any idea how to debug or analyze the issue in order to fix it?

The version of the libraries and Tomcat I'm using is:


"No olvides, no traiciones, lo que llevas bien dentro de ti. No olvides, no
traiciones, lo que siempre te ha hecho vivir."

Reply via email to