Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #9 from orgads/cork-until-open
Browse files Browse the repository at this point in the history
Stream: Do not write before the connection is open
  • Loading branch information
qasim9872 authored Jun 6, 2020
2 parents 481892e + 5b7292a commit 5d814e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/StreamingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class StreamingClient extends Writable {
this.ws.on("message", this._onmessage.bind(this))
this.ws.on("error", this._onerror.bind(this))
this.ws.on("close", this._onclose.bind(this))
this.cork()
}

/**
Expand All @@ -39,6 +40,7 @@ export class StreamingClient extends Writable {
private _onopen() {
debugLog(`opened connection to aws transcribe`)
this.emit(StreamingClient.EVENTS.OPEN)
this.uncork()
}

/**
Expand Down

0 comments on commit 5d814e9

Please sign in to comment.