Skip to content

Commit

Permalink
feat: v5 ws write deadline for private, trade (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokisan authored Nov 2, 2024
1 parent 51de080 commit 28847ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions v5_ws_private.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func (s *V5WebsocketPrivateService) Start(ctx context.Context, errHandler ErrHan
defer close(done)
defer s.connection.Close()
_ = s.connection.SetReadDeadline(time.Now().Add(60 * time.Second))
_ = s.connection.SetWriteDeadline(time.Now().Add(60 * time.Second))
s.connection.SetPongHandler(func(string) error {
_ = s.connection.SetReadDeadline(time.Now().Add(60 * time.Second))
return nil
Expand Down
1 change: 1 addition & 0 deletions v5_ws_trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (s *V5WebsocketTradeService) Start(ctx context.Context, errHandler ErrHandl
defer close(done)
defer s.connection.Close()
_ = s.connection.SetReadDeadline(time.Now().Add(60 * time.Second))
_ = s.connection.SetWriteDeadline(time.Now().Add(60 * time.Second))
s.connection.SetPongHandler(func(string) error {
_ = s.connection.SetReadDeadline(time.Now().Add(60 * time.Second))
return nil
Expand Down

0 comments on commit 28847ad

Please sign in to comment.