nerdbank-streams 2.10.37-alpha → 2.10.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/AcceptanceParameters.d.ts +4 -4
- package/js/AcceptanceParameters.js +2 -2
- package/js/Channel.d.ts +71 -70
- package/js/Channel.js +219 -219
- package/js/Channel.js.map +1 -1
- package/js/ChannelOptions.d.ts +4 -4
- package/js/ChannelOptions.js +2 -2
- package/js/ControlCode.d.ts +30 -30
- package/js/ControlCode.js +34 -34
- package/js/ControlCode.js.map +1 -1
- package/js/Deferred.d.ts +39 -39
- package/js/Deferred.js +67 -67
- package/js/FrameHeader.d.ts +20 -20
- package/js/FrameHeader.js +39 -39
- package/js/FullDuplexStream.d.ts +10 -10
- package/js/FullDuplexStream.js +31 -31
- package/js/IChannelOfferEventArgs.d.ts +17 -17
- package/js/IChannelOfferEventArgs.js +2 -2
- package/js/IDisposableObservable.d.ts +4 -4
- package/js/IDisposableObservable.js +2 -2
- package/js/MultiplexingStream.d.ts +220 -218
- package/js/MultiplexingStream.js +624 -610
- package/js/MultiplexingStream.js.map +1 -1
- package/js/MultiplexingStreamFormatters.d.ts +90 -89
- package/js/MultiplexingStreamFormatters.js +302 -302
- package/js/MultiplexingStreamOptions.d.ts +18 -18
- package/js/MultiplexingStreamOptions.js +2 -2
- package/js/OfferParameters.d.ts +6 -6
- package/js/OfferParameters.js +2 -2
- package/js/QualifiedChannelId.d.ts +25 -25
- package/js/QualifiedChannelId.js +38 -38
- package/js/QualifiedChannelId.js.map +1 -1
- package/js/Utilities.d.ts +12 -11
- package/js/Utilities.js +154 -154
- package/js/index.d.ts +8 -8
- package/js/index.js +15 -15
- package/package.json +18 -18
- package/src/MultiplexingStream.ts +18 -1
|
@@ -377,6 +377,10 @@ export abstract class MultiplexingStream implements IDisposableObservable {
|
|
|
377
377
|
* Disposes the stream.
|
|
378
378
|
*/
|
|
379
379
|
public dispose() {
|
|
380
|
+
this.disposeCore(false)
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
protected disposeCore(remoteDisconnect: boolean) {
|
|
380
384
|
this.disposalTokenSource.cancel()
|
|
381
385
|
this._completionSource.resolve()
|
|
382
386
|
|
|
@@ -394,6 +398,19 @@ export abstract class MultiplexingStream implements IDisposableObservable {
|
|
|
394
398
|
}
|
|
395
399
|
}
|
|
396
400
|
})
|
|
401
|
+
|
|
402
|
+
// Iterate over acceptingChannels to reject each promise
|
|
403
|
+
const errorMessage = remoteDisconnect ? 'The remote party has disconnected.' : 'The stream is being disposed locally.'
|
|
404
|
+
for (const name in this.acceptingChannels) {
|
|
405
|
+
if (this.acceptingChannels.hasOwnProperty(name)) {
|
|
406
|
+
const acceptingChannels = this.acceptingChannels[name]
|
|
407
|
+
for (const channelDeferral of acceptingChannels) {
|
|
408
|
+
channelDeferral.reject(new Error(errorMessage))
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
delete this.acceptingChannels[name]
|
|
412
|
+
}
|
|
413
|
+
}
|
|
397
414
|
}
|
|
398
415
|
|
|
399
416
|
public on(event: 'channelOffered', listener: (args: IChannelOfferEventArgs) => void) {
|
|
@@ -637,7 +654,7 @@ export class MultiplexingStreamClass extends MultiplexingStream {
|
|
|
637
654
|
}
|
|
638
655
|
}
|
|
639
656
|
|
|
640
|
-
this.
|
|
657
|
+
this.disposeCore(true)
|
|
641
658
|
}
|
|
642
659
|
|
|
643
660
|
private onOffer(channelId: QualifiedChannelId, payload: Buffer) {
|