clean the p2palive from debug output

This commit is contained in:
DavidVentura
2024-01-30 13:46:23 +01:00
parent c5764b71a6
commit 550f805c62
+6 -2
View File
@@ -57,14 +57,18 @@ export const makeSession = (cb: msgCb, connCb: connCb, options: opt): Session =>
const cmd = CommandsByValue[raw];
if (options.debug) {
console.log(`>> ${cmd}`);
console.log(hexdump(msg.buffer, { ansi: options.ansi, ansiColor: 0 }));
if (raw != Commands.P2PAlive) {
console.log(hexdump(msg.buffer, { ansi: options.ansi, ansiColor: 0 }));
}
}
if (raw == Commands.Drw) {
session.outgoingCommandId++;
}
sock.send(new Uint8Array(msg.buffer), SEND_PORT, session.dst_ip);
},
broadcast: (msg: DataView) => sock.send(new Uint8Array(msg.buffer), SEND_PORT, BCAST_IP),
broadcast: (msg: DataView) => {
sock.send(new Uint8Array(msg.buffer), SEND_PORT, BCAST_IP);
},
dst_ip: BCAST_IP,
};
return session;