socket.io-client-java icon indicating copy to clipboard operation
socket.io-client-java copied to clipboard

Issue 3g and 4g connections

Open bragonya1992 opened this issue 7 years ago • 3 comments

Hi @nkzawa i need your help, this issue is very complex for me.

i have a android application (chat application) with socket.io nkazawa, but when the cellphone is connect in 3g or 4g network is not stable. Any Idea?

Thanks for your time and bless you.

bragonya1992 avatar May 19 '17 14:05 bragonya1992

@bragonya1992 Did you found a solution?

MInesGomes avatar Mar 29 '19 20:03 MInesGomes

You have to increase the timeout and reconnection delay:

val opts = IO.Options()
opts.reconnection = true
opts.reconnectionDelay = 2000
opts.timeout = 60000

val socket = IO.socket(url, opts)

ffleandro avatar Mar 30 '19 20:03 ffleandro

Thanks @ffleandro. Worked !

In Ionic

socketConf: {
   url: 'http://my.server.url',
   options: { reconnection: true, reconnectionDelay: 3000, timeout: 60000 }
 }

MInesGomes avatar Apr 02 '19 21:04 MInesGomes