我正在实现牛仔 websocket。一切正常,除了当用户关闭浏览器时它会触发 websocket_termination 并且在服务器端它会生成以下错误:-
Error in process <0.298.0> on node 'ews_2@servername.com' with exit value: {function_clause,
[{cowboy_req,ensure_response,[{[]},204],[{file,"src/cowboy_req.erl"},{line,1112}]},
{cowboy_protocol,next_request,3,[{file,"src/cowboy_protocol.erl"},{line,545}]}]}
websocket_termination 中的代码是:-
websocket_terminate(Reason, Req, State) ->
io:format("~nWebsocket connection termination~n"),
ok.