func TLSDialFunc(cfg *tls.Config, timeout time.Duration) (DialFunc, error) {
	dial := func(network, address string) (Conn, error) {
		if _, _, err := net.SplitHostPort(address); err != nil {
			address = net.JoinHostPort(address, defaultSyslogTLSPort)
		}
		dialer := &net.Dialer{Timeout: timeout}
		conn, err := tls.DialWithDialer(dialer, network, address, cfg)
		if err != nil {
			return nil, errors.Annotate(err, "dialing TLS")
		}
		return conn, nil
	}
	return dial, nil
}
// TLSDialFunc returns a dial function that opens a TLS connection. If
// the address passed to the returned func does not include a port then
// the default syslog TLS port (6514) will be used.
TLSDialFunc returns a dial function that opens a TLS connection. If
the address passed to the returned func does not include a port then
the default syslog TLS port (6514) will be used.
// TLSDialFunc returns a dial function that opens a TLS connection . If // the address passed to the returned func does not include a port then // the default syslog TLS port ( 6514 ) will be used .
func TLSDialFunc(cfg *tls.Config, timeout time.Duration) (DialFunc, error) {
	dial := func(network, address string) (Conn, error) {
		if _, _, err := net.SplitHostPort(address); err != nil {
			address = net.JoinHostPort(address, defaultSyslogTLSPort)
		}
		dialer := &net.Dialer{Timeout: timeout}
		conn, err := tls.DialWithDialer(dialer, network, address, cfg)
		if err != nil {
			return nil, errors.Annotate(err, "dialing TLS")
		}
		return conn, nil
	}
	return dial, nil
}
func TLSDialFunc ( cfg * tls . Config , timeout time . Duration ) ( DialFunc , error ) { dial := func ( network , address string ) ( Conn , error ) { if _ , _ , err := net . SplitHostPort ( address ) ; err != nil { address = net . JoinHostPort ( address , defaultSyslogTLSPort ) } dialer := & net . Dialer { Timeout : timeout } conn , err := tls . DialWithDialer ( dialer , network , address , cfg ) if err != nil { return nil , errors . Annotate ( err , " " ) } return conn , nil } return dial , nil }
TLSDialFunc returns a dial function that opens a TLS connection.
TLSDialFunc returns a dial function that opens a TLS connection .