Skip to content

BunSocketTransport

Defined in: protocol/src/bun-socket-transport.ts:26

Transport for one framed data-plane connection.

new BunSocketTransport(_socket): BunSocketTransport

Defined in: protocol/src/bun-socket-transport.ts:29

BunTransportSocket

BunSocketTransport

close(): void

Defined in: protocol/src/bun-socket-transport.ts:56

Tear the connection down and reject any pending backpressure waits.

void

FrameTransport.close


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.

void


pause(): void

Defined in: protocol/src/bun-socket-transport.ts:48

Pause inbound data (receive-side backpressure).

void

FrameTransport.pause


resume(): void

Defined in: protocol/src/bun-socket-transport.ts:52

Resume inbound data.

void

FrameTransport.resume


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.

Buffer

Buffer

Promise<void>

FrameTransport.writeFrame