类:net.Server


🌐 Class: net.Server

此类用于创建 TCP 或 IPC 服务器。

🌐 This class is used to create a TCP or IPC server.

一个正在监听的 TCP net.Server 可以通过在 worker_threads postMessage() 调用的 transferList 中列出它来传递给工作线程。这会将底层的监听套接字移到接收线程,在那里它会继续接受连接。见 把 TCP 句柄转移到其他线程

🌐 A listening TCP net.Server can be transferred to a worker thread by listing it in the transferList of a worker_threads postMessage() call. This moves the underlying listening socket to the receiving thread, where it resumes accepting connections. See Transferring TCP handles to other threads.