func (t *TCPStreamLayer) Close() (err error) {
	return t.ln.Close()
}
Close implements the net.Listener interface.
package store
import (
	"crypto/tls"
	"net"
	"time"
	"github.com/hashicorp/raft"
)
type TCPStreamLayer struct {
	ln        net.Listener
	tlsConfig *tls.Config
}
func NewTCPStreamLayer(ln net.Listener, tlsConfig *tls.Config) (*TCPStreamLayer, error) {
	layer := &TCPStreamLayer{
		ln:        ln,
		tlsConfig: tlsConfig,
	}
	return layer, nil
}
func (t *TCPStreamLayer) Dial(address raft.ServerAddress, timeout time.Duration) (net.Conn, error) {
	if t.tlsConfig == nil {
		return net.DialTimeout("tcp", string(address), timeout)
	}
	dialer := &net.Dialer{
		Timeout: timeout,
	}
	return tls.DialWithDialer(dialer, "tcp", string(address), t.tlsConfig)
}
func (t *TCPStreamLayer) Accept() (c net.Conn, err error) {
	return t.ln.Accept()
}