func (a *TCPAcceptor) GetConnChan() chan PlayerConn {
	return a.connChan
}
GetConnChan gets a connection channel
package acceptor
import (
	"crypto/tls"
	"io"
	"io/ioutil"
	"net"
	"github.com/topfreegames/pitaya/v2/conn/codec"
	"github.com/topfreegames/pitaya/v2/constants"
	"github.com/topfreegames/pitaya/v2/logger"
)
type TCPAcceptor struct {
	addr     string
	connChan chan PlayerConn
	listener net.Listener
	running  bool
	certFile string
	keyFile  string
}
type tcpPlayerConn struct {
	net.Conn
}
func (t *tcpPlayerConn) GetNextMessage() (b []byte, err error) {
	header, err := ioutil.ReadAll(io.LimitReader(t.Conn, codec.HeadLength))
	if err != nil {
		return nil, err
	}
	if len(header) == 0 {
		return nil, constants.ErrConnectionClosed
	}
	msgSize, _, err := codec.ParseHeader(header)
	if err != nil {
		return nil, err
	}
	msgData, err := ioutil.ReadAll(io.LimitReader(t.Conn, int64(msgSize)))
	if err != nil {
		return nil, err
	}
	if len(msgData) < msgSize {
		return nil, constants.ErrReceivedMsgSmallerThanExpected
	}
	return append(header, msgData...), nil
}
func NewTCPAcceptor(addr string, certs ...string) *TCPAcceptor {
	keyFile := ""
	certFile := ""
	if len(certs) != 2 && len(certs) != 0 {
		panic(constants.ErrInvalidCertificates)
	} else if len(certs) == 2 {
		certFile = certs[0]
		keyFile = certs[1]
	}
	return &TCPAcceptor{
		addr:     addr,
		connChan: make(chan PlayerConn),
		running:  false,
		certFile: certFile,
		keyFile:  keyFile,
	}
}
func (a *TCPAcceptor) GetAddr() string {
	if a.listener != nil {
		return a.listener.Addr().String()
	}
	return ""
}