func (mdcli *Mdcli) SetTimeout(timeout time.Duration) {
	mdcli.timeout = timeout
}
These are the class methods. We can set the request timeout and number
of retry attempts, before sending requests:
---------------------------------------------------------------------
Set request timeout.
package mdapi
import (
	zmq "github.com/pebbe/zmq4"
	"errors"
	"log"
	"runtime"
	"time"
)
type Mdcli struct {
	broker  string
	client  *zmq.Socket    
	verbose bool           
	timeout time.Duration  
	retries int            
	poller  *zmq.Poller
}
func (mdcli *Mdcli) ConnectToBroker() (err error) {
	if mdcli.client != nil {
		mdcli.client.Close()
		mdcli.client = nil
	}
	mdcli.client, err = zmq.NewSocket(zmq.REQ)
	if err != nil {
		if mdcli.verbose {
			log.Println("E: ConnectToBroker() creating socket failed")
		}
		return
	}
	mdcli.poller = zmq.NewPoller()
	mdcli.poller.Add(mdcli.client, zmq.POLLIN)
	if mdcli.verbose {
		log.Printf("I: connecting to broker at %s...", mdcli.broker)
	}
	err = mdcli.client.Connect(mdcli.broker)
	if err != nil && mdcli.verbose {
		log.Println("E: ConnectToBroker() failed to connect to broker", mdcli.broker)
	}
	return
}
func NewMdcli(broker string, verbose bool) (mdcli *Mdcli, err error) {
	mdcli = &Mdcli{
		broker:  broker,
		verbose: verbose,
		timeout: time.Duration(2500 * time.Millisecond),
		retries: 3,  
	}
	err = mdcli.ConnectToBroker()
	runtime.SetFinalizer(mdcli, (*Mdcli).Close)
	return
}
func (mdcli *Mdcli) Close() (err error) {
	if mdcli.client != nil {
		err = mdcli.client.Close()
		mdcli.client = nil
	}
	return
}