MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / sendSerialized

Method sendSerialized

projects/JavaScript/proto/fbe.js:5676–5689  ·  view source on GitHub ↗

* Send serialized buffer. * Direct call of the method requires knowledge about internals of FBE models serialization. * Use it with care! * @this {!Sender} * @param {!number} serialized Serialized bytes * @returns {!number} Sent bytes

(serialized)

Source from the content-addressed store, hash-verified

5674 * @returns {!number} Sent bytes
5675 */
5676 sendSerialized (serialized) {
5677 console.assert((serialized > 0), 'Invalid size of the serialized buffer!')
5678 if (serialized <= 0) {
5679 return 0
5680 }
5681
5682 // Shift the send buffer
5683 this._sendBuffer.shift(serialized)
5684
5685 // Send the value
5686 let sent = this.onSend(this._sendBuffer.buffer, 0, this._sendBuffer.size)
5687 this._sendBuffer.remove(0, sent)
5688 return sent
5689 }
5690
5691 /**
5692 * Send message handler

Callers 6

send_OrderMessageMethod · 0.95
send_BalanceMessageMethod · 0.95
send_AccountMessageMethod · 0.95
send_OrderMessageMethod · 0.95
send_BalanceMessageMethod · 0.95
send_AccountMessageMethod · 0.95

Calls 3

onSendMethod · 0.95
shiftMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected