effect-io-ai

Package: @effect/platform-node-shared
Module: NodeSocketServer

NodeSocketServer.make

Creates a scoped TCP SocketServer from a Node net.Server, starts listening with the supplied options, queues pending connections until run is called, and closes the server when the scope ends.

Signature

declare const make: (options: Net.ServerOpts & Net.ListenOptions) => Effect.Effect<{ readonly address: SocketServer.Address; readonly run: <R, E, _>(handler: (socket: Socket.Socket) => Effect.Effect<_, E, R>) => Effect.Effect<never, SocketServer.SocketServerError, R>; }, SocketServer.SocketServerError, Scope.Scope>

Source

Since v4.0.0