func ConnectDealer(d Dealer, endpoint string) error {
	parts := strings.Split(endpoint, "://")

Connect:
	netConn, err := net.Dial(parts[0], parts[1])
	if err != nil {
		time.Sleep(d.RetryInterval())
		goto Connect
	}

	zmtpConn := zmtp.NewConnection(netConn)
	_, err = zmtpConn.Prepare(d.SecurityMechanism(), d.SocketType(), d.SocketIdentity(), false, nil)
	if err != nil {
		return err
	}

	conn := &Connection{
		net:  netConn,
		zmtp: zmtpConn,
	}

	d.AddConnection(conn)
	zmtpConn.RecvMultipart(d.RecvChannel())
	return nil
}
// ConnectDealer accepts a Dealer interface and an endpoint
// in the format <proto>://<address>:<port>. It then attempts
// to connect to the endpoint and perform a ZMTP handshake.
ConnectDealer accepts a Dealer interface and an endpoint
in the format ://:. It then attempts
to connect to the endpoint and perform a ZMTP handshake.
// ConnectDealer accepts a Dealer interface and an endpoint // in the format <proto > : // <address > : <port > . It then attempts // to connect to the endpoint and perform a ZMTP handshake .
func ConnectDealer(d Dealer, endpoint string) error {
	parts := strings.Split(endpoint, "://")
Connect:
	netConn, err := net.Dial(parts[0], parts[1])
	if err != nil {
		time.Sleep(d.RetryInterval())
		goto Connect
	}
	zmtpConn := zmtp.NewConnection(netConn)
	_, err = zmtpConn.Prepare(d.SecurityMechanism(), d.SocketType(), d.SocketIdentity(), false, nil)
	if err != nil {
		return err
	}
	conn := &Connection{
		net:  netConn,
		zmtp: zmtpConn,
	}
	d.AddConnection(conn)
	zmtpConn.RecvMultipart(d.RecvChannel())
	return nil
}
func ConnectDealer ( d Dealer , endpoint string ) error { parts := strings . Split ( endpoint , " " ) Connect : netConn , err := net . Dial ( parts [ 0 ] , parts [ 1 ] ) if err != nil { time . Sleep ( d . RetryInterval ( ) ) goto Connect } zmtpConn := zmtp . NewConnection ( netConn ) _ , err = zmtpConn . Prepare ( d . SecurityMechanism ( ) , d . SocketType ( ) , d . SocketIdentity ( ) , false , nil ) if err != nil { return err } conn := & Connection { net : netConn , zmtp : zmtpConn , } d . AddConnection ( conn ) zmtpConn . RecvMultipart ( d . RecvChannel ( ) ) return nil }
ConnectDealer accepts a Dealer interface and an endpoint
in the format ://:.
ConnectDealer accepts a Dealer interface and an endpoint in the format : // : .