Rapsssito / react-native-tcp-socket

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

Add socket.pause() & socket.resume() methods. Handling multiple TCP response slows down the app. #77

Closed ssvillamor23 closed 3 years ago

ssvillamor23 commented 4 years ago

Hi,

I started learning this React Native and using multiple interfaces with different devices that streaming data. I stumble and stuck up in a situation where My app really slows down that it almost freezes and have to wait 10 seconds for each event and rendering to happened. Everything works fine until I use this component / library

Just some questions:

1) does socket.pause and socket resume were supported by react-native-tcp-socket?

If not, could you please add them as a feature?

2) how do you handle multiple data streaming response from tcp servers using my app as a multiple tcp client? 3) does a tcp connection automatically closes after a response is receive or it continuously listen unless you close it? 4) can I implement this using modbus.?

Help is high appreciated and thanks in advance.

Rapsssito commented 4 years ago

@ssvillamor23, socket.pause() and socket.resume() are not supported yet, but they are coming on the near future (you can check the progress on #41).

  1. how do you handle multiple data streaming response from tcp servers using my app as a multiple tcp client?

I cannot help you with that. However, you can check StackOverflow for Node's net questions about this issue, the code should be the same.

  1. does a tcp connection automatically closes after a response is receive or it continuously listen unless you close it?

TCP is connection-oriented, and a connection between client and server is established before data can be sent and it will remain connected until one of the sides explicitly closes the connection. You can find more info on Wikipedia.

  1. can I implement this using modbus.?

I don't know about Modbus, but it looks it has some versions built on top of TCP (Modbus TCP/IP or Modbus over TCP/IP). react-native-tcp-socket provides a TCP socket API, so you could use it to build your own implementation of Modbus.

github-actions[bot] commented 3 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community attention? This issue may be closed if no further activity occurs.