Tuesday, 13 March, 2018 UTC


Summary

  • Running the echo server examples in I get the following throughput on my laptop – – Emitted when a new connection is established.
  • Read data from the connection.
  • If is , then the readable side of the connection has ended.
  • Write data to the connection.
  • End the writable side of the connection.
GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects.
@vuejsonline: turbo-net: Low Level, High Performance TCP Library for Node – #Vue…
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Low level TCP library for Node.js
const turbo = require(‘turbo-net’) // Echo server that allocates constant memory const server = turbo.createServer(function (socket) { socket.read(Buffer.alloc(32 * 1024), function onread (err, buf, read) { if (err) throw err socket.write(buf, read, function (err) { if (err) throw err socket.read(buf, onread) }) }) }) server.listen(8080, function () { const socket = turbo.connect(8080) socket.read(Buffer.alloc(32), function (err, buf, read) { if (err) throw err console.log(buf.toString(‘utf-8’, 0, read)) }) socket.write(Buffer.from(‘hello world\n ‘)) })
I get the following throughput on my laptop
Create a new TCP server. Options include:
{ allowHalfOpen: false // set to true to allow half open TCP connections }
Emitted when a new connection is established.
Emitted when the server is listening.
Unordered array containing the current active connections
Listen on a port.
Similar to net.Server.address. Useful if you are listening on port 0, to find out which port was picked.
Close the server.
Connect to a TCP server. Options include:
{ allowHalfOpen: false // set to true to allow half open TCP connections }
Emitted when a client connection is fully connected.
Emitted when a client fails to connect.
Emitted a connection is fully closed. No other events will be…
GitHub