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 compatibility improvements #14933

Merged
merged 67 commits into from
Nov 8, 2024

Conversation

cirospaciari
Copy link
Member

@cirospaciari cirospaciari commented Nov 1, 2024

What does this PR do?

Fix: #13217

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

CheckList:

Note: not all options in listen and connect are handled today.

Class: net.BlockList

  • blockList.addAddress(address[, type])
  • blockList.addRange(start, end[, type])
  • blockList.addSubnet(net, prefix[, type])
  • blockList.check(address[, type])
  • blockList.rules

Class: net.SocketAddress

  • new net.SocketAddress([options])
  • socketaddress.address
  • socketaddress.family
  • socketaddress.flowlabel
  • socketaddress.port

Class: net.Server

  • new net.Server([options][, connectionListener])
  • Event: 'close'
  • Event: 'connection'
  • Event: 'error'
  • Event: 'listening'
  • Event: 'drop'
  • server.address()
  • server.close([callback])
  • serverSymbol.asyncDispose
  • server.getConnections(callback)
  • server.listen()
  • server.listen(handle[, backlog][, callback])
  • server.listen(options[, callback])
  • server.listen(path[, backlog][, callback])
  • server.listen([port[, host[, backlog]]][, callback])
  • server.listening
  • server.maxConnections
  • server.ref()
  • server.unref()

Class: net.Socket

  • new net.Socket([options])
  • Event: 'close'
  • Event: 'connect'
  • Event: 'connectionAttempt'
  • Event: 'connectionAttemptFailed'
  • Event: 'connectionAttemptTimeout'
  • Event: 'data'
  • Event: 'drain'
  • Event: 'end'
  • Event: 'error'
  • Event: 'lookup'
  • Event: 'ready'
  • Event: 'timeout'
  • socket.address()
  • socket.autoSelectFamilyAttemptedAddresses
  • socket.bufferSize
  • socket.bytesRead
  • socket.bytesWritten
  • socket.connect()
  • socket.connect(options[, connectListener])
  • socket.connect(path[, connectListener])
  • socket.connect(port[, host][, connectListener])
  • socket.connecting
  • socket.destroy([error])
  • socket.destroyed
  • socket.destroySoon()
  • socket.end([data[, encoding]][, callback])
  • socket.localAddress
  • socket.localPort
  • socket.localFamily
  • socket.pause()
  • socket.pending
  • socket.ref()
  • socket.remoteAddress
  • socket.remoteFamily
  • socket.remotePort
  • socket.resetAndDestroy()
  • socket.resume()
  • socket.setEncoding([encoding])
  • socket.setKeepAlive([enable][, initialDelay])
  • socket.setNoDelay([noDelay])
  • socket.setTimeout(timeout[, callback])
  • socket.timeout
  • socket.unref()
  • socket.write(data[, encoding][, callback])
  • socket.readyState

Module:

  • net.connect()
  • net.connect(options[, connectListener])
  • net.connect(path[, connectListener])
  • net.connect(port[, host][, connectListener])
  • net.createConnection()
  • net.createConnection(options[, connectListener])
  • net.createConnection(path[, connectListener])
  • net.createConnection(port[, host][, connectListener])
  • net.createServer([options][, connectionListener])
  • net.getDefaultAutoSelectFamily()
  • net.setDefaultAutoSelectFamily(value)
  • net.getDefaultAutoSelectFamilyAttemptTimeout()
  • net.setDefaultAutoSelectFamilyAttemptTimeout(value)
  • net.isIP(input)
  • net.isIPv4(input)
  • net.isIPv6(input)

How did you verify your code works?

@robobun
Copy link

robobun commented Nov 1, 2024

@cirospaciari cirospaciari marked this pull request as ready for review November 1, 2024 00:35
packages/bun-usockets/src/eventing/libuv.c Show resolved Hide resolved
packages/bun-usockets/src/loop.c Show resolved Hide resolved
packages/bun-uws/src/HttpContext.h Show resolved Hide resolved
packages/bun-uws/src/HttpContext.h Show resolved Hide resolved
src/bun.js/api/bun/socket.zig Outdated Show resolved Hide resolved
src/bun.js/api/bun/socket.zig Outdated Show resolved Hide resolved
src/js/node/net.ts Outdated Show resolved Hide resolved
src/js/node/net.ts Show resolved Hide resolved
@Jarred-Sumner Jarred-Sumner merged commit 183c661 into main Nov 8, 2024
24 of 25 checks passed
@Jarred-Sumner Jarred-Sumner deleted the ciro/net-compatibility-with-bytesWriten branch November 8, 2024 06:03
@academy-redmaster
Copy link

academy-redmaster commented Nov 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node:tls/node:net - Unix closes when receiving EOF not allowing allowHalfOpen: true to be effective
4 participants