Use Typed Arrays for the send queue
This commit converts the send queue to use typed arrays, and converts message creation functions in 'rfb.js' to create messages directly into the socket's send queue. This commit also removes the separate mouse array, which is no longer needed.
This commit is contained in:
@@ -51,14 +51,9 @@ var FakeWebSocket;
|
||||
},
|
||||
|
||||
_get_sent_data: function () {
|
||||
var arr = [];
|
||||
for (var i = 0; i < this.bufferedAmount; i++) {
|
||||
arr[i] = this._send_queue[i];
|
||||
}
|
||||
|
||||
var res = new Uint8Array(this._send_queue.buffer, 0, this.bufferedAmount);
|
||||
this.bufferedAmount = 0;
|
||||
|
||||
return arr;
|
||||
return res;
|
||||
},
|
||||
|
||||
_open: function (data) {
|
||||
|
||||
Reference in New Issue
Block a user