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.0And create the
optionwithtransportAnd then create socket connection with that
optionand listen on
EVENT_RECONNECT_ATTEMPTthere is no magic under the hood just implement what document told . Read More
NOTE: you can change appropriate
transportname, here I used websocket to be same as document.