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

Socket doesn't connect when React Native remote debugger is on

Open haitaox opened this issue 5 years ago • 7 comments

You want to:

  • [x] report a bug
  • [ ] request a feature

Current behaviour

socket doesn't connect when react native remote debugger is turned on. The error is always timeout. Socket does connect if debugger is turned off.

Expected behaviour

socket should connect regardless of RN debugger being on or off

Setup

  • iOS: 12.4
  • react native: 0.59.8
  • socket.io version: 2.2.0

haitaox avatar Jun 11 '19 01:06 haitaox

I'm having the same problem Did you find any solution?

parth-koshta avatar Jun 18 '19 05:06 parth-koshta

@haitaox @parth-koshta ¿Has encontrado una respuesta para resolver esto?

LucasHimelfarb avatar Jul 10 '19 19:07 LucasHimelfarb

hey bro, get any solution

iarif4u avatar Nov 02 '19 17:11 iarif4u

I think it because different time of device and pc :) so, try to set your pc time same as device time or later than device time.

TaiPhamDuc avatar Nov 06 '19 10:11 TaiPhamDuc

I think it because different time of device and pc :) so, try to set your pc time same as device time or later than device time.

It worked. But this is atrocious. :/

legowtham avatar Jan 22 '21 10:01 legowtham

That sounds weird, the time of the device should not affect the Socket.IO connection... Does somebody have an explanation?

darrachequesne avatar Jan 22 '21 10:01 darrachequesne

That sounds weird, the time of the device should not affect the Socket.IO connection... Does somebody have an explanation?

And also socket connects as new client multiple times even when socket.connect() was not called. Before I synced the time for both pc and device especially working with debugging mode this happened. While on production even if the time is different, socket was working. IMO this has to do with debugging mode. PS: I was using chrome debugger.

Edit: Syncing time also make apps run faster on debugging mode

legowtham avatar Jan 22 '21 10:01 legowtham

For future readers:

Please check our guide with React Native here: https://socket.io/how-to/use-with-react-native

Please reopen if needed.

darrachequesne avatar Apr 10 '24 10:04 darrachequesne