MCPcopy Create free account
hub / github.com/nodejs/node / setOutbound

Method setOutbound

lib/internal/quic/quic.js:2039–2048  ·  view source on GitHub ↗

* Sets the outbound data source for the stream. This can only be called * once and must be called before any data will be sent. The body can be * an ArrayBuffer, a TypedArray or DataView, or a Blob. If the stream * is destroyed or already has an outbound data source, an error will * be t

(outbound)

Source from the content-addressed store, hash-verified

2037 * @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView|Blob} outbound
2038 */
2039 setOutbound(outbound) {
2040 assertIsQuicStream(this);
2041 if (this.destroyed) {
2042 throw new ERR_INVALID_STATE('Stream is destroyed');
2043 }
2044 if (this.#inner.state.hasOutbound) {
2045 throw new ERR_INVALID_STATE('Stream already has an outbound data source');
2046 }
2047 this.#handle.attachSource(validateBody(outbound));
2048 }
2049
2050 /**
2051 * @param {object} headers

Callers

nothing calls this directly

Calls 1

validateBodyFunction · 0.85

Tested by

no test coverage detected