Skip to content

Commit

Permalink
Merge pull request #141 from dvonthenen/flip-retry-ws-to-false
Browse files Browse the repository at this point in the history
On ws.Stop() Turn Retry=False to Stop Reconnecting
  • Loading branch information
dvonthenen authored Dec 7, 2023
2 parents 52ff554 + 8e793dd commit 40b580c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/streaming/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,6 @@ func main() {

// close client
dgClient.Stop()

log.Printf("Program exiting...\n")
}
4 changes: 4 additions & 0 deletions examples/streaming/microphone/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@ func main() {

// close DG client
dgClient.Stop()

log.Printf("Program exiting...\n")
// time.Sleep(120 * time.Second)

}
2 changes: 2 additions & 0 deletions examples/streaming/replay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,6 @@ func main() {

// close client
dgClient.Stop()

log.Printf("Program exiting...\n")
}
1 change: 1 addition & 0 deletions pkg/client/live/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ func (c *Client) Write(p []byte) (int, error) {
// Stop will send close message and shutdown websocket connection
func (c *Client) Stop() {
klog.V(3).Infof("WebSocketClient::Stop Stopping...\n")
c.retry = false
c.ctxCancel()
c.closeWs()
}
Expand Down

0 comments on commit 40b580c

Please sign in to comment.