Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c550701dfa |
@@ -235,7 +235,10 @@ func (wsClient *SafeWebsocketClient) connect() error {
|
||||
|
||||
pingCtx, pingCancel := context.WithCancel(context.Background())
|
||||
go wsClient.startPingTicker(pingCtx)
|
||||
wsClient.cancelFuncs = append(wsClient.cancelFuncs, pingCancel)
|
||||
wsClient.mu.WriteHandler(func() error {
|
||||
wsClient.cancelFuncs = append(wsClient.cancelFuncs, pingCancel)
|
||||
return nil
|
||||
})
|
||||
|
||||
if wsClient.conn != nil {
|
||||
wsClient.conn.Close()
|
||||
@@ -251,7 +254,10 @@ func (wsClient *SafeWebsocketClient) connect() error {
|
||||
|
||||
go func() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
wsClient.cancelFuncs = append(wsClient.cancelFuncs, cancel)
|
||||
wsClient.mu.WriteHandler(func() error {
|
||||
wsClient.cancelFuncs = append(wsClient.cancelFuncs, cancel)
|
||||
return nil
|
||||
})
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
@@ -285,7 +291,10 @@ func (wsClient *SafeWebsocketClient) connect() error {
|
||||
|
||||
go func() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
wsClient.cancelFuncs = append(wsClient.cancelFuncs, cancel)
|
||||
wsClient.mu.WriteHandler(func() error {
|
||||
wsClient.cancelFuncs = append(wsClient.cancelFuncs, cancel)
|
||||
return nil
|
||||
})
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
||||
Reference in New Issue
Block a user