BunSocketTransport
Defined in: protocol/src/bun-socket-transport.ts:26
Transport for one framed data-plane connection.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BunSocketTransport(
_socket):BunSocketTransport
Defined in: protocol/src/bun-socket-transport.ts:29
Parameters
Section titled “Parameters”_socket
Section titled “_socket”Returns
Section titled “Returns”BunSocketTransport
Methods
Section titled “Methods”close()
Section titled “close()”close():
void
Defined in: protocol/src/bun-socket-transport.ts:56
Tear the connection down and reject any pending backpressure waits.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”handleDrain()
Section titled “handleDrain()”handleDrain():
void
Defined in: protocol/src/bun-socket-transport.ts:36
Call from the runtime’s socket drain handler. Bun delivers drain
through the fixed handler object passed to Bun.listen/Bun.connect, so
the adapter owns the wiring and forwards the event here.
Returns
Section titled “Returns”void
pause()
Section titled “pause()”pause():
void
Defined in: protocol/src/bun-socket-transport.ts:48
Pause inbound data (receive-side backpressure).
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”resume()
Section titled “resume()”resume():
void
Defined in: protocol/src/bun-socket-transport.ts:52
Resume inbound data.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”writeFrame()
Section titled “writeFrame()”writeFrame(
header,payload):Promise<void>
Defined in: protocol/src/bun-socket-transport.ts:40
Write header+payload contiguously as one wire frame. Resolves once the bytes have been fully handed to the OS (i.e. after any backpressure has drained); rejects if the connection dies first.
Parameters
Section titled “Parameters”header
Section titled “header”Buffer
payload
Section titled “payload”Buffer
Returns
Section titled “Returns”Promise<void>