我有 ServerEndpoint 类:
@ServerEndpoint(value = "/websocket", configurator = ServletAwareConfig.class)
public class WebsocketEndpoint {
@OnOpen
public void onOpen(Session session) {
System.out.println("OnOpen");
}
@OnClose
public void onClose(Session session) {
System.out.println("OnClose");
}
@OnMessage
public void onMessage(String message, Session session) {
System.out.println("OnMessage");
}
@OnError
public void onError(Throwable t) throws Throwable {
System.out.println("OnError");
}
}
当我刷新页面时,调用了 onError 并且异常 t 包含下一个描述: java.util.concurrent.ExecutionException: java.net.SocketException: Broken pipe
可能是什么原因?