https://issues.apache.org/bugzilla/show_bug.cgi?id=56449

            Bug ID: 56449
           Summary: WebSocket session get closed if in onOpen will
                    sendText (sync mode)
           Product: Tomcat 8
           Version: 8.0.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: veliscu.cri...@gmail.com

Created attachment 31552
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31552&action=edit
The exception captured

@ServerEndpoint("/push/echo")
public class EchoAnnotation {    
    @OnOpen
    public void open(Session session) {
        try { 
            if(session.isOpen()) session.getBasicRemote().sendText(
            "Welcome!");
        } catch(Exception e) { 
            try {
                session.close();
            } catch (IOException e1) {
                // Ignore
            }
        }
    }


Doing session.getAsynRemote() is working.
Important: This errors happens with thousands of websockets.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to