问题
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