Heim  >  Fragen und Antworten  >  Hauptteil

html5 - WebSocket提示错误: WebSocket is already in CLOSING or CLOSED state?

提示错误:

WebSocket is already in CLOSING or CLOSED state?
迷茫迷茫2741 Tage vor3955

Antworte allen(2)Ich werde antworten

  • 怪我咯

    怪我咯2017-04-17 11:43:57

    这个提示给的信息太少了,
    如果你是个前端开发者,我建议你打开chrome的控制台,看看是不是有一条错误消息就像下边这样的:WebSocket handshake: Unexpected response code: 404 -
    我在开始学习的时候也是看到了上边的那个close ,然后我打开了控制台就看到了这个问题:websocket在初始化也就是三次握手的时候出了问题

    第一个想法就是:是不是路径不对,然后检查前台后台的空格问题,后来把所有的路径问题检查一遍就可以跑了
    stackoverflow上的答案这个说的其他的解答:http://stackoverflow.com/ques...

    Antwort
    0
  • 怪我咯

    怪我咯2017-04-17 11:43:57

    查看一下状态
    php xxx.php status
    查看exit_status状态码
    然后看有没有抛出异常

    Antwort
    0
  • StornierenAntwort