示例#1
0
文件: worker.go 项目: dustinrc/gonzo
func (w *worker) Dial() error {
	if w.conn != nil {
		return nil
	}

	conn, err := gonzo.NewConnection(w.url, zmq.DEALER)
	if err != nil {
		return err
	}

	w.conn = conn
	return nil
}
示例#2
0
文件: client.go 项目: dustinrc/gonzo
func (c *client) Dial() error {
	if c.conn != nil {
		return nil
	}

	conn, err := gonzo.NewConnection(c.url, zmq.REQ)
	if err != nil {
		return err
	}

	c.conn = conn
	return nil
}