func (soc *Socket) SetAffinity(value uint64) error {
	return soc.setUInt64(C.ZMQ_AFFINITY, value)
}
ZMQ_AFFINITY: Set I/O thread affinity

See: http://api.zeromq.org/4-1:zmq-setsockopt#toc3
package zmq4
import "C"
import (
	"time"
	"unsafe"
)
func (soc *Socket) setString(opt C.int, s string) error {
	if !soc.opened {
		return ErrorSocketClosed
	}
	cs := C.CString(s)
	defer C.free(unsafe.Pointer(cs))
	var i C.int
	var err error
	for {
		i, err = C.zmq4_setsockopt(soc.soc, opt, unsafe.Pointer(cs), C.size_t(len(s)))
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return errget(err)
	}
	return nil
}
func (soc *Socket) setNullString(opt C.int) error {
	if !soc.opened {
		return ErrorSocketClosed
	}
	var i C.int
	var err error
	for {
		i, err = C.zmq4_setsockopt(soc.soc, opt, nil, 0)
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return errget(err)
	}
	return nil
}
func (soc *Socket) setInt(opt C.int, value int) error {
	if !soc.opened {
		return ErrorSocketClosed
	}
	val := C.int(value)
	var i C.int
	var err error
	for {
		i, err = C.zmq4_setsockopt(soc.soc, opt, unsafe.Pointer(&val), C.size_t(unsafe.Sizeof(val)))
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return errget(err)
	}
	return nil
}
func (soc *Socket) setInt64(opt C.int, value int64) error {
	if !soc.opened {
		return ErrorSocketClosed
	}
	val := C.int64_t(value)
	var i C.int
	var err error
	for {
		i, err = C.zmq4_setsockopt(soc.soc, opt, unsafe.Pointer(&val), C.size_t(unsafe.Sizeof(val)))
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return errget(err)
	}
	return nil
}
func (soc *Socket) setUInt64(opt C.int, value uint64) error {
	if !soc.opened {
		return ErrorSocketClosed
	}
	val := C.uint64_t(value)
	var i C.int
	var err error
	for {
		i, err = C.zmq4_setsockopt(soc.soc, opt, unsafe.Pointer(&val), C.size_t(unsafe.Sizeof(val)))
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return errget(err)
	}
	return nil
}
func (soc *Socket) SetSndhwm(value int) error {
	return soc.setInt(C.ZMQ_SNDHWM, value)
}
func (soc *Socket) SetRcvhwm(value int) error {
	return soc.setInt(C.ZMQ_RCVHWM, value)
}