我有两台计算机连接到凤凰服务器。服务于两者的js是相同的。两者都运行相同版本的Chrome。一个是Windows,另一个是OSX。
OSX计算机行为正常。然而,Windows计算机永远不会在chan.join()调用上得到“确定”。
let socket = new Socket('ws://testapi.com:4000/socket', opts);
socket.connect();
let chan = socket.channel('rooms:' + room);
chan.join()
.receive("ok", ({messages}) => console.log("catching up", messages) )
.receive("error", ({reason}) => console.log("failed join", reason) )
.receive("timeout", () => console.log("Networking issue. Still waiting..."));
几秒钟后,Windows计算机将注销超时消息。 在网络活动中,我看到正在建立websocket连接,其上唯一的流量是:
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"1"}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"2"}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"3"}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"4"}
等
我无法从服务器日志中获得任何提示。没有错误被抛出。