func (cn *connection) reopen() error {
	cn.close()
	return cn.open(cn.severAddress, cn.timeout)
}
reopen reopens the current connection.
Because the code generated by Fbthrift does not handle the seqID,
the message will be dislocated when the timeout occurs, resulting in unexpected response.
When the timeout occurs, the connection will be reopened to avoid the impact of the message.
package nebula_go
import (
	"crypto/tls"
	"fmt"
	"math"
	"time"
	"github.com/facebook/fbthrift/thrift/lib/go/thrift"
	"github.com/vesoft-inc/nebula-go/v2/nebula"
	"github.com/vesoft-inc/nebula-go/v2/nebula/graph"
)
type connection struct {
	severAddress HostAddress
	timeout      time.Duration
	returnedAt   time.Time  
	graph        *graph.GraphServiceClient
}
func newConnection(severAddress HostAddress) *connection {
	return &connection{
		severAddress: severAddress,
		timeout:      0 * time.Millisecond,
		returnedAt:   time.Now(),
		graph:        nil,
	}
}
func (cn *connection) open(hostAddress HostAddress, timeout time.Duration) error {
	return cn.openSSL(hostAddress, timeout, nil)
}
func (cn *connection) openSSL(hostAddress HostAddress, timeout time.Duration, sslConfig *tls.Config) error {
	ip := hostAddress.Host
	port := hostAddress.Port
	newAdd := fmt.Sprintf("%s:%d", ip, port)
	cn.timeout = timeout
	bufferSize := 128 << 10
	frameMaxLength := uint32(math.MaxUint32)
	var err error
	var sock thrift.Transport
	if sslConfig != nil {
		sock, err = thrift.NewSSLSocketTimeout(newAdd, sslConfig, timeout)
	} else {
		sock, err = thrift.NewSocket(thrift.SocketAddr(newAdd), thrift.SocketTimeout(timeout))
	}
	if err != nil {
		return fmt.Errorf("failed to create a net.Conn-backed Transport,: %s", err.Error())
	}
	bufferedTranFactory := thrift.NewBufferedTransportFactory(bufferSize)
	transport := thrift.NewFramedTransportMaxLength(bufferedTranFactory.GetTransport(sock), frameMaxLength)
	pf := thrift.NewBinaryProtocolFactoryDefault()
	cn.graph = graph.NewGraphServiceClientFactory(transport, pf)
	if err = cn.graph.Open(); err != nil {
		return fmt.Errorf("failed to open transport, error: %s", err.Error())
	}
	if !cn.graph.IsOpen() {
		return fmt.Errorf("transport is off")
	}
	return cn.verifyClientVersion()
}
func (cn *connection) verifyClientVersion() error {
	req := graph.NewVerifyClientVersionReq()
	resp, err := cn.graph.VerifyClientVersion(req)
	if err != nil {
		return fmt.Errorf("failed to verify client version: %s", err.Error())
	}
	if resp.GetErrorCode() != nebula.ErrorCode_SUCCEEDED {
		return fmt.Errorf("incompatible version between client and server: %s.", string(resp.GetErrorMsg()))
	}
	return nil
}