Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crash On Socket Read and Write #196

Open
wilhemknight opened this issue Jun 26, 2024 · 0 comments
Open

App Crash On Socket Read and Write #196

wilhemknight opened this issue Jun 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@wilhemknight
Copy link

Description

The Application always cause a crash every time I write a large amount of data to the socket I tried it on multiple devices, i observed that the larger the memory size of the device the more data can be read and written.
My best guess is that some data artifacts remain on the devices memory even after the socket is destroyed

My Code Looks Something Like This:

     Server >>
      socket.on("data", function (dataBuffer) {

          //Data is processed and saved to a file
         //       About 2800 Lines Of Code
        // Then Socket Is ended and destroyed after this data chuck is processed
       // Each Data chunk is read as an object  file i.e "{" is start and "}" is end

      })
    
   Client >>
   Seperate Physical Device
    //Generates Data and writes to server after socket is destroyed then a new chunk of data is sent 
    // With each (1024 * 976) byte chunk the socket writes then (AWAITS for write to end and) sends a new (1024 * 976) byte chunk
     /** I EVENT TRIED A 10 SECOND TIMEOUT AFTER EACH CHUNK WRITE TO SEE IF IT WAS FROM THE CLIENT**/
    // On a 1gb ram device about (1024 * 976) * 57 byte chunks of data can be sent to the server before it crashes
    // On a 4gb ram device about (1024 * 976) * 200+ byte chunks of data can be sent to server before it crashes  

I tried editing some of the methods in the Socket.js file in the node_modules/react-native-tcp-socket folder to see if i could clear memory on each write not sure what i was doing half the time but nothing seemed to work

Relevant information

OS ios/android
react-native 0.63.5
react-native-tcp-socket 6.0.6
@wilhemknight wilhemknight added the bug Something isn't working label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant