Removed connection logs

This commit is contained in:
Mitchell McCaffrey 2021-01-04 13:44:20 +11:00
parent c89a75a23e
commit 26b474452c
2 changed files with 0 additions and 8 deletions

View File

@ -15,13 +15,11 @@ class Connection extends SimplePeer {
this.dataChannels = {};
this.on("data", this.handleData);
this.on("datachannel", this.handleDataChannel);
super._debug = console.log;
}
// Intercept the data event with decoding and chunking support
handleData(packed) {
const unpacked = decode(packed);
console.log("data", unpacked);
// If the special property __chunked is set and true
// The data is a partial chunk of the a larger file
// So wait until all chunks are collected and assembled
@ -64,7 +62,6 @@ class Connection extends SimplePeer {
if (packedData.byteLength > MAX_BUFFER_SIZE) {
const chunks = this.chunk(packedData);
for (let chunk of chunks) {
console.log("sending", chunk);
if (this.dataChannels[channel]) {
// Write to the stream to allow for buffer / backpressure handling
this.dataChannels[channel].write(encode(chunk));
@ -98,7 +95,6 @@ class Connection extends SimplePeer {
this.dataChannels[channelName] = channel;
channel.on("data", this.handleData.bind(this));
channel.on("error", (error) => {
console.error("error", error);
this.emit("error", error);
});
}

View File

@ -193,10 +193,6 @@ class Session extends EventEmitter {
trickle: true,
config: { iceServers: this._iceServers },
});
// if (initiator) {
// connection.createDataChannel("map", { iceServers: this._iceServers });
// connection.createDataChannel("token", { iceServers: this._iceServers });
// }
const peer = { id, connection, initiator, ready: false };
function sendPeer(id, data, channel) {