Rapsssito / react-native-tcp-socket

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

iOS info tcp_connection_is_cellular No connected path #137

Closed pablozandona closed 2 years ago

pablozandona commented 2 years ago

Description

I need to establish a connection to a device with an STM microcontroller. On android it works fine with the same code.

The socket was created, as shown in the createConnection callback, but on iOS it doesn't send data, and it doesn't trigger an error in on('error'.

Steps to reproduce

Or code:

const socket = TcpSocket.createConnection({
    host: HOST,
    port: 31320,
}, () => {
  console.info(">> CREATED SOCKET");
  socket.write(new Buffer([65, 112, 112, 67, 105, 101, 67, 109, 100, 73, 0, 0, 78, 48, 49, 50]));
});

Current behavior

These messages are shown in the Xcode log:

2022-01-29 19:28:33.938595-0300 appprogramadorcie[500:31121] [javascript] >> CREATED SOCKET
2022-01-29 19:28:33.939043-0300 appprogramadorcie[500:31135] [connection] nw_connection_copy_connected_path [C3] Client called nw_connection_copy_connected_path on unconnected nw_connection
2022-01-29 19:28:33.939393-0300 appprogramadorcie[500:31135] [] tcp_connection_is_cellular No connected path

Relevant information

OS iOS 15.2.1 and iOS 12.5.5
react-native 0.64.2
react-native-tcp-socket 5.5.0
Rapsssito commented 2 years ago

@pablozandona, is the callback from the write() function being called?

pablozandona commented 2 years ago

It wasn't responding because it was sending the wrong byte packet. Sorry for the report.