func DialTCPFn(addr string, timeoutReadWrite time.Duration, privKey crypto.PrivKey) SocketDialer {
	return func() (net.Conn, error) {
		conn, err := tmnet.Connect(addr)
		if err == nil {
			deadline := time.Now().Add(timeoutReadWrite)
			err = conn.SetDeadline(deadline)
		}
		if err == nil {
			conn, err = MakeSecretConnection(conn, privKey)
		}
		return conn, err
	}
}
DialTCPFn dials the given tcp addr, using the given timeoutReadWrite and
privKey for the authenticated encryption handshake.
package privval
import (
	"errors"
	"net"
	"time"
	"github.com/tendermint/tendermint/crypto"
	tmnet "github.com/tendermint/tendermint/libs/net"
)
var (
	ErrDialRetryMax = errors.New("dialed maximum retries")
)
type SocketDialer func() (net.Conn, error)