@libp2p/webrtc
Advanced tools
Comparing version 3.1.9 to 3.1.10-0ee4f784
@@ -9,3 +9,2 @@ import { CodeError } from '@libp2p/interface/errors'; | ||
import { Message } from './pb/message.js'; | ||
const log = logger('libp2p:webrtc:stream'); | ||
// Max message size that can be sent to the DataChannel | ||
@@ -61,3 +60,3 @@ const MAX_MESSAGE_SIZE = 16 * 1024; | ||
default: | ||
log.error('unknown datachannel state %s', this.channel.readyState); | ||
this.log.error('unknown datachannel state %s', this.channel.readyState); | ||
throw new CodeError('Unknown datachannel state', 'ERR_INVALID_STATE'); | ||
@@ -79,3 +78,3 @@ } | ||
void this.close().catch(err => { | ||
log.error('error closing stream after channel closed', err); | ||
this.log.error('error closing stream after channel closed', err); | ||
}); | ||
@@ -106,3 +105,3 @@ }; | ||
.catch(err => { | ||
log.error('error processing incoming data channel messages', err); | ||
this.log.error('error processing incoming data channel messages', err); | ||
}); | ||
@@ -142,3 +141,3 @@ } | ||
else { | ||
log.error('unknown datachannel state %s', this.channel.readyState); | ||
this.log.error('unknown datachannel state %s', this.channel.readyState); | ||
throw new CodeError('Unknown datachannel state', 'ERR_INVALID_STATE'); | ||
@@ -190,3 +189,3 @@ } | ||
async _sendFlag(flag) { | ||
log.trace('Sending flag: %s', flag.toString()); | ||
this.log.trace('Sending flag: %s', flag.toString()); | ||
const msgbuf = Message.encode({ flag }); | ||
@@ -206,5 +205,5 @@ const prefixedBuf = lengthPrefixed.encode.single(msgbuf); | ||
channel, | ||
log: logger(`libp2p:mplex:stream:${direction}:${channel.id}`) | ||
log: logger(`libp2p:webrtc:stream:${direction}:${channel.id}`) | ||
}); | ||
} | ||
//# sourceMappingURL=stream.js.map |
{ | ||
"name": "@libp2p/webrtc", | ||
"version": "3.1.9", | ||
"version": "3.1.10-0ee4f784", | ||
"description": "A libp2p transport using WebRTC connections", | ||
@@ -48,6 +48,6 @@ "license": "Apache-2.0 OR MIT", | ||
"@chainsafe/libp2p-noise": "^13.0.0", | ||
"@libp2p/interface": "^0.1.2", | ||
"@libp2p/interface-internal": "^0.1.4", | ||
"@libp2p/logger": "^3.0.2", | ||
"@libp2p/peer-id": "^3.0.2", | ||
"@libp2p/interface": "0.1.2-0ee4f784", | ||
"@libp2p/interface-internal": "0.1.4-0ee4f784", | ||
"@libp2p/logger": "3.0.2-0ee4f784", | ||
"@libp2p/peer-id": "3.0.2-0ee4f784", | ||
"@multiformats/mafmt": "^12.1.2", | ||
@@ -74,5 +74,5 @@ "@multiformats/multiaddr": "^12.1.5", | ||
"@chainsafe/libp2p-yamux": "^5.0.0", | ||
"@libp2p/interface-compliance-tests": "^4.0.5", | ||
"@libp2p/peer-id-factory": "^3.0.3", | ||
"@libp2p/websockets": "^7.0.5", | ||
"@libp2p/interface-compliance-tests": "4.0.5-0ee4f784", | ||
"@libp2p/peer-id-factory": "3.0.3-0ee4f784", | ||
"@libp2p/websockets": "7.0.6-0ee4f784", | ||
"@types/sinon": "^10.0.15", | ||
@@ -84,3 +84,3 @@ "aegir": "^40.0.8", | ||
"it-pair": "^2.0.6", | ||
"libp2p": "^0.46.9", | ||
"libp2p": "0.46.10-0ee4f784", | ||
"protons": "^7.0.2", | ||
@@ -87,0 +87,0 @@ "sinon": "^15.1.2", |
@@ -11,4 +11,2 @@ import { CodeError } from '@libp2p/interface/errors' | ||
const log = logger('libp2p:webrtc:stream') | ||
export interface DataChannelOpts { | ||
@@ -96,3 +94,3 @@ maxMessageSize: number | ||
default: | ||
log.error('unknown datachannel state %s', this.channel.readyState) | ||
this.log.error('unknown datachannel state %s', this.channel.readyState) | ||
throw new CodeError('Unknown datachannel state', 'ERR_INVALID_STATE') | ||
@@ -117,3 +115,3 @@ } | ||
void this.close().catch(err => { | ||
log.error('error closing stream after channel closed', err) | ||
this.log.error('error closing stream after channel closed', err) | ||
}) | ||
@@ -151,3 +149,3 @@ } | ||
.catch(err => { | ||
log.error('error processing incoming data channel messages', err) | ||
this.log.error('error processing incoming data channel messages', err) | ||
}) | ||
@@ -190,3 +188,3 @@ } | ||
} else { | ||
log.error('unknown datachannel state %s', this.channel.readyState) | ||
this.log.error('unknown datachannel state %s', this.channel.readyState) | ||
throw new CodeError('Unknown datachannel state', 'ERR_INVALID_STATE') | ||
@@ -250,3 +248,3 @@ } | ||
private async _sendFlag (flag: Message.Flag): Promise<void> { | ||
log.trace('Sending flag: %s', flag.toString()) | ||
this.log.trace('Sending flag: %s', flag.toString()) | ||
const msgbuf = Message.encode({ flag }) | ||
@@ -290,4 +288,4 @@ const prefixedBuf = lengthPrefixed.encode.single(msgbuf) | ||
channel, | ||
log: logger(`libp2p:mplex:stream:${direction}:${channel.id}`) | ||
log: logger(`libp2p:webrtc:stream:${direction}:${channel.id}`) | ||
}) | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
657494
121
5994
1
+ Added@libp2p/interface@0.1.2-0ee4f784(transitive)
+ Added@libp2p/interface-internal@0.1.4-0ee4f784(transitive)
+ Added@libp2p/logger@3.0.2-0ee4f784(transitive)
+ Added@libp2p/peer-collections@4.0.3-0ee4f784(transitive)
+ Added@libp2p/peer-id@3.0.2-0ee4f784(transitive)
- Removed@libp2p/interface-internal@0.1.12(transitive)
- Removed@libp2p/peer-collections@4.0.11(transitive)