leftover
This commit is contained in:
parent
c9350aa8db
commit
9c2cbb1921
|
@ -1,7 +1,7 @@
|
|||
class FLYSocket {
|
||||
constructor(ws,
|
||||
callbackData = this.callbackDummy,
|
||||
callbackRaw = this.callbackDummy) {
|
||||
callbackData = null,
|
||||
callbackRaw = null) {
|
||||
this.ws = new WebSocket(ws);
|
||||
this.pointer = 0;
|
||||
|
||||
|
@ -15,11 +15,10 @@ class FLYSocket {
|
|||
new Response(event.data).arrayBuffer().then(
|
||||
function(buff) {
|
||||
let data = new DataView(buff);
|
||||
this.callbackRaw(data);
|
||||
|
||||
if (this.callbackData != this.callbackDummy) {
|
||||
if (this.callbackRaw !== null)
|
||||
this.callbackRaw(data);
|
||||
if (this.callbackData !== null)
|
||||
this.callbackData( this.parse(data) );
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
||||
}
|
||||
|
@ -186,11 +185,7 @@ class FLYSocket {
|
|||
|
||||
*buffer2HexArray(buff, start = 0, end = buff.byteLength) {
|
||||
for (let i = start; i < end; i++) {
|
||||
yield hex.push( buff.getUint8(i).toString(16) );
|
||||
yield buff.getUint8(i).toString(16);
|
||||
}
|
||||
}
|
||||
|
||||
callbackDummy(_) {}
|
||||
}
|
||||
|
||||
console.log("OK") // TODO: please remove...
|
||||
}
|
Loading…
Reference in New Issue
Block a user