fix: binary emission
This commit is contained in:
parent
629f410a10
commit
b872e4b6e4
|
@ -47,8 +47,7 @@ export default class SocketClient extends decorate(Class) {
|
|||
this.socket = io(this.address, {
|
||||
...this.options,
|
||||
});
|
||||
const precalc = this.socket.binary(true);
|
||||
this.socket.emitPromise = promisify(precalc.emit.bind(precalc));
|
||||
this.socket.emitPromise = promisify(this.socket.emit.bind(this.socket));
|
||||
this.socket.on('connect', () => {
|
||||
debug('connect');
|
||||
this.isConnected = true;
|
||||
|
@ -100,7 +99,7 @@ export default class SocketClient extends decorate(Class) {
|
|||
}
|
||||
|
||||
send(packet) {
|
||||
return this.constructor.send(this.latus, this.socket, packet, 'emitPromise');
|
||||
return this.constructor.send(this.latus, this.socket.binary(true), packet, 'emitPromise');
|
||||
}
|
||||
|
||||
to(room) {
|
||||
|
|
|
@ -18,8 +18,7 @@ export default class ServerSocket extends decorate(Class) {
|
|||
super();
|
||||
this.latus = latus;
|
||||
this.socket = socket;
|
||||
const precalc = this.socket.binary(true);
|
||||
this.socket.emitPromise = promisify(precalc.emit.bind(precalc));
|
||||
this.socket.emitPromise = promisify(this.socket.emit.bind(this.socket));
|
||||
this.socket.joinPromise = promisify(this.socket.join.bind(this.socket));
|
||||
this.socket.leavePromise = promisify(this.socket.leave.bind(this.socket));
|
||||
const Packets = Object.entries(packets(latus).fromType);
|
||||
|
@ -73,7 +72,7 @@ export default class ServerSocket extends decorate(Class) {
|
|||
}
|
||||
|
||||
send(packet) {
|
||||
return this.constructor.send(this.latus, this.socket, packet, 'emitPromise');
|
||||
return this.constructor.send(this.latus, this.socket.binary(true), packet, 'emitPromise');
|
||||
}
|
||||
|
||||
to(room) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user