Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-datachannel

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-datachannel - npm Package Compare versions

Comparing version 0.0.26 to 0.0.27

2

CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
project(node_datachannel VERSION 0.0.26)
project(node_datachannel VERSION 0.0.27)

@@ -5,0 +5,0 @@ include_directories(${CMAKE_JS_INC})

@@ -99,9 +99,12 @@ const nodeDataChannel = require('../../lib/index');

setInterval(() => {
console.log(`${i++}# Sent: ${formatRate(bytesSent)} KB/s Received: ${formatRate(bytesReceived)} KB/s SendBufferAmount: ${dc.bufferedAmount()} DataChannelOpen: ${dc.isOpen()}`);
console.log(`${i++}# Sent: ${byte2KB(bytesSent)} KB/s / Received: ${byte2KB(bytesReceived)} KB/s / SendBufferAmount: ${dc.bufferedAmount()} / DataChannelOpen: ${dc.isOpen()}`);
bytesSent = 0;
bytesReceived = 0;
function formatRate(bytes) {
return `${Math.round(bytes / 1024)}`
}
}, 1000);
setInterval(() => {
console.log(`Stats# Sent: ${byte2MB(pcMap[peerId].bytesSent())} MB / Received: ${byte2MB(pcMap[peerId].bytesReceived())} MB / rtt: ${pcMap[peerId].rtt()} ms`);
console.log(`Selected Candidates# ${JSON.stringify(pcMap[peerId].getSelectedCandidatePair())}`);
console.log(``);
}, 5 * 1000);
}

@@ -154,9 +157,12 @@ });

setInterval(() => {
console.log(`${i++}# Sent: ${formatRate(bytesSent)} KB/s Received: ${formatRate(bytesReceived)} KB/s SendBufferAmount: ${dc.bufferedAmount()} DataChannelOpen: ${dc.isOpen()}`);
console.log(`${i++}# Sent: ${byte2KB(bytesSent)} KB/s / Received: ${byte2KB(bytesReceived)} KB/s / SendBufferAmount: ${dc.bufferedAmount()} / DataChannelOpen: ${dc.isOpen()}`);
bytesSent = 0;
bytesReceived = 0;
function formatRate(bytes) {
return `${Math.round(bytes / 1024)}`
}
}, 1000);
setInterval(() => {
console.log(`Stats# Sent: ${byte2MB(pcMap[peerId].bytesSent())} MB / Received: ${byte2MB(pcMap[peerId].bytesReceived())} MB / rtt: ${pcMap[peerId].rtt()} ms`);
console.log(`Selected Candidates# ${JSON.stringify(pcMap[peerId].getSelectedCandidatePair())}`);
console.log(``);
}, 5 * 1000);
});

@@ -175,2 +181,10 @@

return result;
}
function byte2KB(bytes) {
return `${Math.round(bytes / 1024)}`
}
function byte2MB(bytes) {
return `${Math.round(bytes / (1024 * 1024))}`
}

@@ -15,3 +15,3 @@ const nodeDataChannel = require('../../lib/index');

// Message Size
const MESSAGE_SIZE = 1000;
const MESSAGE_SIZE = 500;

@@ -94,9 +94,12 @@ // Buffer Size

setInterval(() => {
console.log(`${i++}# Sent: ${formatRate(bytesSent)} KB/s Received: ${formatRate(bytesReceived)} KB/s SendBufferAmount: ${dc.bufferedAmount()} DataChannelOpen: ${dc.isOpen()}`);
console.log(`${i++}# Sent: ${byte2KB(bytesSent)} KB/s / Received: ${byte2KB(bytesReceived)} KB/s / SendBufferAmount: ${dc.bufferedAmount()} / DataChannelOpen: ${dc.isOpen()}`);
bytesSent = 0;
bytesReceived = 0;
function formatRate(bytes) {
return `${Math.round(bytes / 1024)}`
}
}, 1000);
setInterval(() => {
console.log(`Stats# Sent: ${byte2MB(pcMap[peerId].bytesSent())} MB / Received: ${byte2MB(pcMap[peerId].bytesReceived())} MB / rtt: ${pcMap[peerId].rtt()} ms`);
console.log(`Selected Candidates# ${JSON.stringify(pcMap[peerId].getSelectedCandidatePair())}`);
console.log(``);
}, 5 * 1000);
}

@@ -144,9 +147,12 @@ });

setInterval(() => {
console.log(`${i++}# Sent: ${formatRate(bytesSent)} KB/s Received: ${formatRate(bytesReceived)} KB/s SendBufferAmount: ${dc.bufferedAmount()} DataChannelOpen: ${dc.isOpen()}`);
console.log(`${i++}# Sent: ${byte2KB(bytesSent)} KB/s / Received: ${byte2KB(bytesReceived)} KB/s / SendBufferAmount: ${dc.bufferedAmount()} / DataChannelOpen: ${dc.isOpen()}`);
bytesSent = 0;
bytesReceived = 0;
function formatRate(bytes) {
return `${Math.round(bytes / 1024)}`
}
}, 1000);
setInterval(() => {
console.log(`Stats# Sent: ${byte2MB(pcMap[peerId].bytesSent())} MB / Received: ${byte2MB(pcMap[peerId].bytesReceived())} MB / rtt: ${pcMap[peerId].rtt()} ms`);
console.log(`Selected Candidates# ${JSON.stringify(pcMap[peerId].getSelectedCandidatePair())}`);
console.log(``);
}, 5 * 1000);
});

@@ -165,2 +171,10 @@

return result;
}
function byte2KB(bytes) {
return `${Math.round(bytes / 1024)}`
}
function byte2MB(bytes) {
return `${Math.round(bytes / (1024 * 1024))}`
}

@@ -73,2 +73,9 @@ export as namespace NodeDataChannel;

export interface SelectedCandidateInfo {
address: string;
port: number;
type: string;
transportType: string;
}
export class DataChannel {

@@ -103,2 +110,6 @@ close: () => void;

onDataChannel: (cb: (dc: DataChannel) => void) => void;
bytesSent: () => number;
bytesReceived: () => number;
rtt: () => number;
getSelectedCandidatePair: () => { local: SelectedCandidateInfo, remote: SelectedCandidateInfo } | null;
}
{
"name": "node-datachannel",
"version": "0.0.26",
"version": "0.0.27",
"description": "libdatachannel node bindings",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc