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

Server documentation error #79

Closed liran closed 3 years ago

liran commented 3 years ago

There is an error in the code to start a server. https://github.com/Rapsssito/react-native-tcp-socket#server

const server = TcpSocket.createServer(function(socket) {
  socket.on('data', (data) => {
    socket.write('Echo server', data);
  });

  socket.on('error', (error) => {
    console.log('An error ocurred with client socket ', error);
  });

  socket.on('close', (error) => {
    console.log('Closed connection with ', socket.address());
  });
}).listen(12345, '0.0.0.0'); // here
// listen({ port: 12345, host: '0.0.0.0' }); // right

This is why #57 appears.

Rapsssito commented 3 years ago

@liran, thanks! You are right, I will fix it right now.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 4.5.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: