Tutorial by Examples

// Include Nodejs' net module. const Net = require('net'); // The port on which the server is listening. const port = 8080; // Use net.createServer() in your code. This is just for illustration purpose. // Create a new TCP server. const server = new Net.Server(); // The server listens to a ...
// Include Nodejs' net module. const Net = require('net'); // The port number and hostname of the server. const port = 8080; const host = 'localhost'; // Create a new TCP client. const client = new Net.Socket(); // Send a connection request to the server. client.connect({ port: port, host:...

Page 1 of 1