【问题标题】:Atmosphere Websocket support onHandshake event for WebSocketEventListenerAdapterAtmosphere Websocket 支持 WebSocketEventListenerAdapter 的 onHandshake 事件
【发布时间】:2015-02-17 12:45:21
【问题描述】:

WebSocketEventListenerAdapter 为您提供了实现 onHandshake 事件的选项:

@Override
public void onHandshake(WebSocketEvent event) {
    LOG.debug("{}", event);
}

我需要在握手期间进行一些第三方操作,但它似乎不起作用

如果客户端不应该连接,Atmosphere 如何在握手期间触发某些操作并中断握手?

我在 onOpen 事件上执行此操作,但我想避免它,因为如果根据我的逻辑我调用 AtmosphereResource.close() 来关闭连接,客户端首先连接然后断开连接。

我目前正在使用带有 dropwizard(即码头)的 Atmosphere,如下所示:https://github.com/mgutz/dropwizard-atmosphere

Netty 还有一个实现叫做netosphere 是否可以实现 onHandshake 事件?

谢谢

【问题讨论】:

    标签: jetty netty dropwizard atmosphere


    【解决方案1】:

    是的,它应该可以工作。您使用的是哪个服务器?让我们在邮件列表上进行讨论,因为某些服务器可能不受支持。但可以肯定的是,它适用于 nettosphere。

    https://groups.google.com/group/atmosphere-framework?pli=1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-10
      • 2015-08-03
      相关资源
      最近更新 更多