Rapsssito / react-native-tcp-socket

React Native TCP socket API for Android, iOS & macOS with SSL/TLS support.
MIT License
303 stars 81 forks source link

feat(Android): Add support for Android concurrent connections (multiple networks) #193

Closed smartmedev closed 3 weeks ago

smartmedev commented 1 month ago

Impovements on this forks

For apps targeting Android 12 (API level 31) or higher, devices that support concurrent peer-to-peer and internet connections can maintain simultaneous Wi-Fi connections to both the peer device and the primary internet-providing network, making the user experience more seamless. We add support for Android concurrent connections, routing all data traffic to the peer-to-peer network connection selecting the correct network based on the host DHCP address or subnet address. This change is essential to open a tcp socket and send data towards ioT devices that expose a WiFi network without internet access. See: https://developer.android.com/about/versions/12/behavior-changes-12#concurrent-connections.

Executed tests

I've tested this changes on three devices - all works great:

  1. Google Pixel 8 - Android 14
  2. Samsung A22 - Android 13
  3. Redmi Note 7- Android 10

React Native version is 0.74.1

vricosti commented 1 month ago

If nothings happens in the next weeks I will be tempted to start of a fork of this project but in the mean timeI will use the patch strategy: https://medium.com/@yusufsancakk/comprehensive-guide-to-patching-react-native-packages-f7f73836ce6c

smartmedev commented 1 month ago

Hi @vricosti the project seem not maintained too much unfortunately. I've made my fork, and now i'm using that fork on my personal package.json.

"react-native-tcp-socket": "github:smartmedev/react-native-tcp-socket",

Rapsssito commented 3 weeks ago

@smartmedev, thanks for the PR! Sorry for the delay. Could you please remove the changes in README.md so I can merge the PR?

smartmedev commented 3 weeks ago

Hi @Rapsssito ! I've just removed the changes from README.md so you can merge the PR

github-actions[bot] commented 3 weeks ago

:tada: This PR is included in version 6.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: