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

net.createServer(options, listener) is not supported #183

Open
achingbrain opened this issue Dec 12, 2023 · 0 comments
Open

net.createServer(options, listener) is not supported #183

achingbrain opened this issue Dec 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@achingbrain
Copy link

Description

net.createServer has an optional options argument as the first parameter - https://nodejs.org/api/net.html#netcreateserveroptions-connectionlistener

This module expects the first option to be a listener:

/**
* @param {(socket: Socket) => void} connectionListener
* @returns {Server}
*/
function createServer(connectionListener) {
return new Server(connectionListener);
}

Steps to reproduce

const server = net.connect({
  noDelay: true,
  keepAlive: true
}, () => {
  console.info('server started')
})

Current behavior

An error is thrown

TypeError: The listener must be a function

Expected behavior

The options object should be supported.

Relevant information

OS iOS
react-native 0.72
react-native-tcp-socket 6.0.6
@achingbrain achingbrain added the bug Something isn't working label Dec 12, 2023
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