PeelTechnologies / react-native-tcp

node's net api in react-native
MIT License
284 stars 213 forks source link

Invalid data, chunk must be a string or buffer, not object #115

Closed BoyZhouY closed 3 years ago

BoyZhouY commented 3 years ago

When I call the write method, an "Invalid data, chunk must be a string or buffer, not object" error appears?

BoyZhouY commented 3 years ago

Use the buffer parameter in advance in the _write method of the TcpSocket class "Let _buf = Buffer.from(buffer);" conversion and replace "else if (Buffer.isBuffer(buffer))" with "else if (Buffer.isBuffer(_buf))"