mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 23:16:51 +00:00
Bugfix: Websocket ping/pong improvements (#406)
* Renames func. Creates new func to setup pinghander either via gorilla style or our own
* Cleans up all ping pong handlers.......
* Clears up issues, makes naming a bit better
* Adds tests
* Adds ping support to binance
* Cleans up ping pongs and adds a comment
* Cleans up waitgroup stuff.
* DISCREETLY cleans up woeful function
* Fixes Kraken ping message type. Removes unnecessary test property. Adds `if err == websocket.ErrCloseSent {` to ping func
* +1 for +v
This commit is contained in:
@@ -284,7 +284,7 @@ func (o *OKGroup) WsLogin() error {
|
||||
base64,
|
||||
},
|
||||
}
|
||||
err := o.WebsocketConn.SendMessage(request)
|
||||
err := o.WebsocketConn.SendJSONMessage(request)
|
||||
if err != nil {
|
||||
o.Websocket.SetCanUseAuthenticatedEndpoints(false)
|
||||
return err
|
||||
@@ -827,7 +827,7 @@ func (o *OKGroup) Subscribe(channelToSubscribe wshandler.WebsocketChannelSubscri
|
||||
channelToSubscribe.Currency.Base.String()}
|
||||
}
|
||||
|
||||
return o.WebsocketConn.SendMessage(request)
|
||||
return o.WebsocketConn.SendJSONMessage(request)
|
||||
}
|
||||
|
||||
// Unsubscribe sends a websocket message to stop receiving data from the channel
|
||||
@@ -838,5 +838,5 @@ func (o *OKGroup) Unsubscribe(channelToSubscribe wshandler.WebsocketChannelSubsc
|
||||
delimiterColon +
|
||||
channelToSubscribe.Currency.String()},
|
||||
}
|
||||
return o.WebsocketConn.SendMessage(request)
|
||||
return o.WebsocketConn.SendJSONMessage(request)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user