Closed kyour-cn closed 2 years ago
在Http和Websocket共存的项目,使用了onClose事件监听。 当有http请求结束也会触发onClose,请问我该如何区分该断开的连接是什么类型呢?
if ($ws instanceof \Swoole\Http\Server) { //去除http请求 return; }
在Http和Websocket共存的项目,使用了onClose事件监听。 当有http请求结束也会触发onClose,请问我该如何区分该断开的连接是什么类型呢?