gpt4 book ai didi

org.atmosphere.websocket.WebSocket.close()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 13:15:05 27 4
gpt4 key购买 nike

本文整理了Java中org.atmosphere.websocket.WebSocket.close()方法的一些代码示例,展示了WebSocket.close()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebSocket.close()方法的具体详情如下:
包路径:org.atmosphere.websocket.WebSocket
类名称:WebSocket
方法名:close

WebSocket.close介绍

暂无

代码示例

代码示例来源:origin: Atmosphere/atmosphere

@Override
public void close(AtmosphereResponse r) throws IOException {
  logger.trace("WebSocket.close() for {}", uuid);
  try {
    // Never trust underlying server.
    // https://github.com/Atmosphere/atmosphere/issues/1633
    if (r.request() != null && r.request().getAttribute(CLEAN_CLOSE) == null) {
      close();
    }
  } catch (Exception ex) {
    logger.trace("", ex);
  }
  try {
    bb.clear();
    cb.clear();
    // NOTE #1961 if the buffer is cached at thread-local, it needs to be released here.
  } catch (Exception ex) {
    logger.trace("", ex);
  }
}

代码示例来源:origin: Atmosphere/atmosphere

public void dirtyClose() {
  try {
    event.setCancelled(true);
    notifyListeners();
    cancel();
    if (webSocket != null) {
      webSocket.close();
    }
  } catch (IOException ex) {
    logger.trace("", ex);
  }
}

代码示例来源:origin: Atmosphere/atmosphere

@Override
public void close() throws IOException {
  event.setCloseByApplication(true);
  notifyListeners();
  cancel();
  if (webSocket != null && webSocket.isOpen()) {
    webSocket.close();
  }
}

代码示例来源:origin: Atmosphere/atmosphere

webSocket.close();
} else {
  AsynchronousProcessor.class.cast(config.framework().getAsyncSupport()).endRequest(AtmosphereResourceImpl.class.cast(r), true);

代码示例来源:origin: Atmosphere/atmosphere

private void finish(WebSocket webSocket, AtmosphereResource resource, AtmosphereRequest r, AtmosphereResponse s, boolean closeWebSocket) {
  // Don't take any risk in case something goes wrong and remove the associated resource.
  framework.atmosphereFactory().remove(resource.uuid());
  if (webSocket != null) {
    try {
      r.setAttribute(WebSocket.CLEAN_CLOSE, Boolean.TRUE);
      webSocket.resource(null);
      if (closeWebSocket) webSocket.close(s);
    } catch (IOException e) {
      logger.trace("", e);
    }
  }
  if (r != null) {
    r.destroy(true);
  }
  if (s != null) {
    s.destroy(true);
  }
}

代码示例来源:origin: Atmosphere/atmosphere-extensions

@Override
public void disconnect() {
  logger.trace("calling from " + this.getClass().getName() + " : " + "disconnect");
  session.onDisconnect(DisconnectReason.DISCONNECT);
  webSocket.close();
}

代码示例来源:origin: Atmosphere/atmosphere-extensions

@Override
public void abort() {
  logger.trace("calling from " + this.getClass().getName() + " : " + "abort");
  webSocket.close();
  webSocket = null;
  session.onShutdown();
}

代码示例来源:origin: Atmosphere/atmosphere-vertx

@Override
  public void handle(Throwable event) {
    w.close();
    logger.debug("", event);
    webSocketProcessor.close(w, 1006);
  }
});

代码示例来源:origin: motown-io/motown

public void close() {
  if (webSocket != null && webSocket.isOpen()) {
    webSocket.close();
  }
}

代码示例来源:origin: com.vaadin.external.atmosphere/atmosphere-socketio

@Override
public void abort() {
  logger.trace("calling from " + this.getClass().getName() + " : " + "abort");
  try {
    webSocket.close();
  } catch (IOException e) {
    e.printStackTrace();
  }
  webSocket = null;
  session.onShutdown();
}

代码示例来源:origin: com.vaadin.external.atmosphere/atmosphere-socketio

@Override
public void disconnect() {
  logger.trace("calling from " + this.getClass().getName() + " : " + "disconnect");
  session.onDisconnect(DisconnectReason.DISCONNECT);
  try {
    webSocket.close();
  } catch (IOException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: motown-io/motown

if (webSocket != null && webSocket.isOpen()) {
  webSocket.close();

代码示例来源:origin: Atmosphere/atmosphere-vertx

w.close();
  webSocketProcessor.close(w, 1005);
});

代码示例来源:origin: Atmosphere/atmosphere-extensions

sessionWrapper.initiated(true);
} catch (Exception e) {
  sessionWrapper.webSocket().close();
  sessionWrapper.getSession().onShutdown();
sessionWrapper.webSocket().close();
sessionWrapper.getSession().onShutdown();

代码示例来源:origin: com.vaadin.external.atmosphere/atmosphere-socketio

e.printStackTrace();
  try {
    sessionWrapper.webSocket().close();
  } catch (IOException e1) {
    e1.printStackTrace();
  sessionWrapper.webSocket().close();
} catch (IOException e1) {
  e1.printStackTrace();

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com