func (cs *connectorSource) Endpoints() ([]*endpoint.Endpoint, error) {
	endpoints := []*endpoint.Endpoint{}

	conn, err := net.DialTimeout("tcp", cs.remoteServer, dialTimeout)
	if err != nil {
		log.Errorf("Connection error: %v", err)
		return nil, err
	}
	defer conn.Close()

	decoder := gob.NewDecoder(conn)
	if err := decoder.Decode(&endpoints); err != nil {
		log.Errorf("Decode error: %v", err)
		return nil, err
	}

	log.Debugf("Recieved endpoints: %#v", endpoints)

	return endpoints, nil
}
func (cs *connectorSource) Endpoints() ([]*endpoint.Endpoint, error) {
	endpoints := []*endpoint.Endpoint{}

	conn, err := net.DialTimeout("tcp", cs.remoteServer, dialTimeout)
	if err != nil {
		log.Errorf("Connection error: %v", err)
		return nil, err
	}
	defer conn.Close()

	decoder := gob.NewDecoder(conn)
	if err := decoder.Decode(&endpoints); err != nil {
		log.Errorf("Decode error: %v", err)
		return nil, err
	}

	log.Debugf("Recieved endpoints: %#v", endpoints)

	return endpoints, nil
}
// Endpoints returns endpoint objects.