While I am testing my real chat application on 3G mobile network (Slow internet connection),
Socket.io
repeatedly disconnects then reconnects. I have logged the reason.
it says "xhr post error"
which raise "transport error"
then disconnect.
May I know what is the meaning of "xhr post error"
and why this error appears in slow connection and how to solve the problem?.
I am using socket.io-client.java version 0.4.2
First of all update the dependency to
1.0.0
And create the
option
withtransport
And then create socket connection with that
option
and listen on
EVENT_RECONNECT_ATTEMPT
there is no magic under the hood just implement what document told . Read More
NOTE: you can change appropriate
transport
name, here I used websocket to be same as document.