端点支持的帧集保留位

时间:2019-06-04 12:59:28

标签: java tomcat websocket

尝试设置简单的Tomcat 9服务器。

package server.ws;

import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.server.ServerEndpoint;




@ServerEndpoint("/websocketendpoint")

public class WsServer {

    @OnOpen
    public void onOpen(){
        System.out.println("Open Connection ...");
    }

    @OnClose
    public void onClose(){
        System.out.println("Close Connection ...");
    }

    @OnMessage
    public String onMessage(String message){
        System.out.println("Message from the client: " + message);
        String echoMsg = "Echo from the server : " + message;
        return echoMsg;
    }

    @OnError
    public void onError(Throwable e){
        e.printStackTrace();
    }

}

不幸的是我遇到错误:

The client frame set the reserved bits to [4] for a message with opCode [7] which was not supported by this endpoint

为什么我会遇到此错误以及如何解决呢?

0 个答案:

没有答案