当我通过 Wi-Fi 连接到套接字时,一切正常,这是 Logger 日志:
2018-11-01 11:54:44.395 : io.socket.client.IO: ignoring socket cache for http://myserverexample.com:80/
2018-11-01 11:54:44.402 : io.socket.client.Manager: readyState CLOSED
2018-11-01 11:54:44.405 : io.socket.client.Manager: opening http://myserverexample.com:80/
2018-11-01 11:54:44.408 : io.socket.client.Manager: connection attempt will timeout after 20000
2018-11-01 11:54:44.411 : .socket.engineio.client.Socket: creating transport 'polling'
2018-11-01 11:54:44.413 : .socket.engineio.client.Socket: setting transport polling
2018-11-01 11:54:44.415 : neio.client.transports.Polling: polling
2018-11-01 11:54:44.417 : o.client.transports.PollingXHR: xhr poll
2018-11-01 11:54:44.421 : o.client.transports.PollingXHR: xhr open GET: http://myserverexample.com/socket.io/?EIO=3&transport=polling
2018-11-01 11:54:44.423 : o.client.transports.PollingXHR: sending xhr with url http://myserverexample.com/socket.io/?EIO=3&transport=polling | data null
但是当我尝试通过移动互联网轮询连接时,得到的数据如下 xml:
neio.client.transports.Polling: polling got data <?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="FEHLER" title="ERROR">
<p>
The requested item could not be loaded <br/>
Wrong MIME-Type
<do type="prev" label="back">
<prev/>
</do>
</p>
</card>
</wml>
然后我收到
mSocket.on(Socket.EVENT_CONNECT_ERROR, new Emitter.Listener() {
@Override
public void call(Object... args) {
if (args.length> 0 && args[0] instanceof EngineIOException){
((EngineIOException)args[0]).printStackTrace();
}
}
});
富国沪深
相关分类