Now that you understand the net.Server
and net.Socket
objects, you are ready to jump in and implement some Node.js TCP clients and servers. This guides you through the process of implementing basic TCP clients and servers in Node.js.
The examples in the following sections are extremely basic, to make it easy for you to grasp the concepts of starting the TCP server listening on a port and then implementing clients that can connect. The examples are designed to help you see the interactions and event handling that need to be implemented.