Lines Matching refs:data

223         // the body MAY contain UTF-8-encoded data with value /reason/
251 * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
253 send (data) {
258 data = webidl.converters.WebSocketSendData(data)
277 // If data is a string
278 if (typeof data === 'string') {
281 // must send a WebSocket Message comprised of the data argument
282 // using a text frame opcode; if the data cannot be sent, e.g.
290 const value = Buffer.from(data)
298 } else if (types.isArrayBuffer(data)) {
301 // send a WebSocket Message comprised of data using a binary frame
302 // opcode; if the data cannot be sent, e.g. because it would need
305 // The data to be sent is the data stored in the buffer described
311 const value = Buffer.from(data)
319 } else if (ArrayBuffer.isView(data)) {
322 // send a WebSocket Message comprised of data using a binary frame
323 // opcode; if the data cannot be sent, e.g. because it would need to
326 // data to be sent is the data stored in the section of the buffer
327 // described by the ArrayBuffer object that data references. Any
330 // by the length of data’s buffer in bytes.
332 const ab = Buffer.from(data, data.byteOffset, data.byteLength)
341 } else if (isBlobLike(data)) {
344 // send a WebSocket Message comprised of data using a binary frame
345 // opcode; if the data cannot be sent, e.g. because it would need to
347 // WebSocket as full and then close the WebSocket connection. The data
348 // to be sent is the raw data represented by the Blob object. Any
351 // of the Blob object’s raw data, in bytes.
355 data.arrayBuffer().then((ab) => {