TCP Server
The TCP Server class provides the ability to accept incoming TCP connections.
import TCPServer from "embedded:io/tcp-server";Constructor
Section titled “Constructor”TCPServer(options)
Section titled “TCPServer(options)”Creates a new TCP server object instance.
TCPServer(options)Parameters
Section titled “Parameters”options
io- AnIOconstructor options object for the underlying TCP listener socket.
port- The port number to listen on.
Instance Properties
Section titled “Instance Properties”The port the server is listening on.
server.portInstance Methods
Section titled “Instance Methods”close()
Section titled “close()”Closes the TCP server and all active connections.
close()#tcpReadable(count)
Section titled “#tcpReadable(count)”A method that is called when a new client connection is available.
tcpReadable(count)Parameters
Section titled “Parameters”count - The number of available connections.
Return Value
Section titled “Return Value”A TCP Server Connection instance.