react-native-socketio icon indicating copy to clipboard operation
react-native-socketio copied to clipboard

[Support Request] Multiple client problem

Open ithieund opened this issue 9 years ago • 2 comments

@gcrabtree , This plugin was great, but when I created 2 client in the same app, there was a problem with incoming message.

Situation:

  • I have 1 server which run 2 socket.io app: 1 for notification, 1 for messaging, both use the same event name 'message' to listen for message from client.
  • In my app, I have 2 client: 1 for notification, 1 for messaging, using you plugin.

The problem is, when there was 1 message sent from 1 of the servers, both client receive that message :(

That make me a headache a lot. Can you please help me figure out what cause this and how to fix it?

Thanks.

ithieund avatar Jan 11 '17 08:01 ithieund

@gcrabtree , I tried with the js version of socket.io-client and it worked perfect https://www.npmjs.com/package/socket.io-client

I think your plugin does not support to create multiple client, which will share the memory between clients or something like that and cause this problem.

I think you should fix this asap. Thanks.

ithieund avatar Jan 23 '17 03:01 ithieund

Unfortunately the socketio js client does not support background reconnects, which was a no go for our company. I made a PR fixing the multiple sockets problem on Android: https://github.com/gcrabtree/react-native-socketio/pull/46

saalihou avatar Jun 14 '18 00:06 saalihou