SignalR WebRTC WebSocket is already in CLOSING or CLOSED state

独自空忆成欢 提交于 2019-12-10 03:09:14

问题


I wanted to take a test run of the simplest implementation of SignalR and WebRTC. I hosted the code in https://github.com/foyzulkarim/WebRtc

I made two different files "index.html" and "index1.html". In index.html I broadcasted a video file through signalr and it went very well. But when I just replace existing video file with WebCam's feed, it started getting error.

After running couple of second I start getting this error "WebSocket is already in CLOSING or CLOSED state." I tried to throttle but no change, still get the error. Any idea why it might happening?

Error image

You can check the video i http://1drv.ms/1meM1OI


回答1:


The message size seems to be the key problem here.

In your project, every frame of video is about 40k but every frame of cam is more than 140K. Actually, in index.html when you broadcast the video, after about 20s, there will be several frames larger than 70k which will also give you the same error.

I tried sending some long string messages as a test, and I do get errors when the message is longer than a certain value. However, I was not able to find in the documentation a definite limitation of message length or message density.




回答2:


I had similliar problem running websocket app server on Glassfish 4 with port 8080, After I changed my port to another it works (eg: 8887), probably this is a temporary solution before finding the permanent solution for port 8080.

Edit: Found the root cause, my antivirus was using port 80 which is used by websocket. If You find the similiar problem check your antivirus/other aplication port.



来源:https://stackoverflow.com/questions/24836741/signalr-webrtc-websocket-is-already-in-closing-or-closed-state

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!