func NewTCPClient(opts ...ClientOption) Client {
	return newClient(TCP_CLIENT, opts...)
}
NewTcpClient function builds a tcp client.
package getty
import (
	"crypto/tls"
	"crypto/x509"
	"encoding/pem"
	"fmt"
	"io/ioutil"
	"net"
	"strings"
	"sync"
	"sync/atomic"
	"time"
)
import (
	"github.com/dubbogo/gost/bytes"
	"github.com/dubbogo/gost/net"
	"github.com/gorilla/websocket"
	perrors "github.com/pkg/errors"
)
const (
	reconnectInterval = 3e8  
	connectInterval   = 5e8  
	connectTimeout    = 3e9
	maxTimes          = 10
)
var (
	sessionClientKey   = "session-client-owner"
	connectPingPackage = []byte("connect-ping")
)
var (
	clientID = EndPointID(0)
)
type client struct {
	ClientOptions
	endPointID EndPointID
	sync.Mutex
	endPointType EndPointType
	newSession NewSessionCallback
	ssMap      map[Session]struct{}
	sync.Once
	done chan struct{}
	wg   sync.WaitGroup
}
func (c *client) init(opts ...ClientOption) {
	for _, opt := range opts {
		opt(&(c.ClientOptions))
	}
}
func newClient(t EndPointType, opts ...ClientOption) *client {
	c := &client{
		endPointID:   atomic.AddInt32(&clientID, 1),
		endPointType: t,
		done:         make(chan struct{}),
	}
	c.init(opts...)
	if c.number <= 0 || c.addr == "" {
		panic(fmt.Sprintf("client type:%s, @connNum:%d, @serverAddr:%s", t, c.number, c.addr))
	}
	c.ssMap = make(map[Session]struct{}, c.number)
	return c
}