FiberSocket.adopt

FiberSocket adopt(FiberScheduler sched, ref EventLoop loop, Handle clientHandle) static @trusted nothrow

Create a FiberSocket by adopting an already-connected handle.

Used in server accept loops where TcpListener.onAccept provides a Handle for the newly accepted client.

Parameters

schedThe fiber scheduler that manages the calling fiber.
loopThe event loop the handle was registered on.
clientHandleThe OS handle from onAccept.

Returns

A FiberSocket wrapping the adopted connection, or an

unconnected FiberSocket if adoption failed.