func (p *WebSocketV2ClientBase) Connect(autoConnect bool) {
	p.lastReceivedTime = time.Now()
	p.connectWebSocket()
	if autoConnect {
		p.startTicker()
	}
}
Connect to websocket server
if autoConnect is true, then the connection can be re-connect if no data received after the pre-defined timeout
package websocketclientbase
import (
	"fmt"
	"github.com/gorilla/websocket"
	"github.com/huobirdcenter/huobi_golang/internal/gzip"
	"github.com/huobirdcenter/huobi_golang/internal/model"
	"github.com/huobirdcenter/huobi_golang/internal/requestbuilder"
	"github.com/huobirdcenter/huobi_golang/logging/applogger"
	"github.com/huobirdcenter/huobi_golang/pkg/model/auth"
	"github.com/huobirdcenter/huobi_golang/pkg/model/base"
	"sync"
	"time"
)
const (
	websocketV2Path = "/ws/v2"
)
type AuthenticationV2ResponseHandler func(resp *auth.WebSocketV2AuthenticationResponse)
type WebSocketV2ClientBase struct {
	host string
	conn *websocket.Conn
	authenticationResponseHandler AuthenticationV2ResponseHandler
	messageHandler                MessageHandler
	responseHandler               ResponseHandler
	stopReadChannel   chan int
	stopTickerChannel chan int
	ticker            *time.Ticker
	lastReceivedTime  time.Time
	sendMutex         *sync.Mutex
	requestBuilder *requestbuilder.WebSocketV2RequestBuilder
}
func (p *WebSocketV2ClientBase) Init(accessKey string, secretKey string, host string) *WebSocketV2ClientBase {
	p.host = host
	p.stopReadChannel = make(chan int, 1)
	p.stopTickerChannel = make(chan int, 1)
	p.requestBuilder = new(requestbuilder.WebSocketV2RequestBuilder).Init(accessKey, secretKey, host, websocketV2Path)
	p.sendMutex = &sync.Mutex{}
	return p
}
func (p *WebSocketV2ClientBase) SetHandler(authHandler AuthenticationV2ResponseHandler, msgHandler MessageHandler, repHandler ResponseHandler) {
	p.authenticationResponseHandler = authHandler
	p.messageHandler = msgHandler
	p.responseHandler = repHandler
}