문제

I am implementing cowboy websocket. Everything is working fine except when user closes the browser it fires websocket_termination and at server end it generates following error:-

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}]}]}

Code in websocket_termination is :-

websocket_terminate(Reason, Req, State) ->
io:format("~nWebsocket connection termination~n"),
ok.
도움이 되었습니까?

해결책

Resolved: Problem was Req was not getting passed and got manipulated between the callbacks... Cowboy needs a proper Req parameter to be passed at the time of connection termination.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top