func (soc *Socket) SetVmciBufferMinSize(value uint64) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return soc.setUInt64(C.ZMQ_VMCI_BUFFER_MIN_SIZE, value)
}
ZMQ_VMCI_BUFFER_MIN_SIZE: Set min buffer size of the VMCI socket

Returns ErrorNotImplemented42 with ZeroMQ version < 4.2

See: http://api.zeromq.org/4-2:zmq-setsockopt#toc69
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)
}
func (soc *Socket) SetAffinity(value uint64) error {
	return soc.setUInt64(C.ZMQ_AFFINITY, value)
}
func (soc *Socket) SetSubscribe(filter string) error {
	return soc.setString(C.ZMQ_SUBSCRIBE, filter)
}
func (soc *Socket) SetUnsubscribe(filter string) error {
	return soc.setString(C.ZMQ_UNSUBSCRIBE, filter)
}
func (soc *Socket) SetIdentity(value string) error {
	return soc.setString(C.ZMQ_IDENTITY, value)
}
func (soc *Socket) SetRate(value int) error {
	return soc.setInt(C.ZMQ_RATE, value)
}
func (soc *Socket) SetRecoveryIvl(value time.Duration) error {
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_RECOVERY_IVL, val)
}
func (soc *Socket) SetSndbuf(value int) error {
	return soc.setInt(C.ZMQ_SNDBUF, value)
}
func (soc *Socket) SetRcvbuf(value int) error {
	return soc.setInt(C.ZMQ_RCVBUF, value)
}
func (soc *Socket) SetLinger(value time.Duration) error {
	val := int(value / time.Millisecond)
	if value == -1 {
		val = -1
	}
	return soc.setInt(C.ZMQ_LINGER, val)
}
func (soc *Socket) SetReconnectIvl(value time.Duration) error {
	val := int(value / time.Millisecond)
	if value == -1 {
		val = -1
	}
	return soc.setInt(C.ZMQ_RECONNECT_IVL, val)
}
func (soc *Socket) SetReconnectIvlMax(value time.Duration) error {
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_RECONNECT_IVL_MAX, val)
}
func (soc *Socket) SetBacklog(value int) error {
	return soc.setInt(C.ZMQ_BACKLOG, value)
}
func (soc *Socket) SetMaxmsgsize(value int64) error {
	return soc.setInt64(C.ZMQ_MAXMSGSIZE, value)
}
func (soc *Socket) SetMulticastHops(value int) error {
	return soc.setInt(C.ZMQ_MULTICAST_HOPS, value)
}
func (soc *Socket) SetRcvtimeo(value time.Duration) error {
	val := int(value / time.Millisecond)
	if value == -1 {
		val = -1
	}
	return soc.setInt(C.ZMQ_RCVTIMEO, val)
}
func (soc *Socket) SetSndtimeo(value time.Duration) error {
	val := int(value / time.Millisecond)
	if value == -1 {
		val = -1
	}
	return soc.setInt(C.ZMQ_SNDTIMEO, val)
}
func (soc *Socket) SetIpv6(value bool) error {
	val := 0
	if value {
		val = 1
	}
	return soc.setInt(C.ZMQ_IPV6, val)
}
func (soc *Socket) SetImmediate(value bool) error {
	val := 0
	if value {
		val = 1
	}
	return soc.setInt(C.ZMQ_IMMEDIATE, val)
}
func (soc *Socket) SetRouterMandatory(value int) error {
	return soc.setInt(C.ZMQ_ROUTER_MANDATORY, value)
}
func (soc *Socket) SetRouterRaw(value int) error {
	return soc.setInt(C.ZMQ_ROUTER_RAW, value)
}
func (soc *Socket) SetProbeRouter(value int) error {
	return soc.setInt(C.ZMQ_PROBE_ROUTER, value)
}
func (soc *Socket) SetXpubVerbose(value int) error {
	return soc.setInt(C.ZMQ_XPUB_VERBOSE, value)
}
func (soc *Socket) SetReqCorrelate(value int) error {
	return soc.setInt(C.ZMQ_REQ_CORRELATE, value)
}
func (soc *Socket) SetReqRelaxed(value int) error {
	return soc.setInt(C.ZMQ_REQ_RELAXED, value)
}
func (soc *Socket) SetTcpKeepalive(value int) error {
	return soc.setInt(C.ZMQ_TCP_KEEPALIVE, value)
}
func (soc *Socket) SetTcpKeepaliveIdle(value int) error {
	return soc.setInt(C.ZMQ_TCP_KEEPALIVE_IDLE, value)
}
func (soc *Socket) SetTcpKeepaliveCnt(value int) error {
	return soc.setInt(C.ZMQ_TCP_KEEPALIVE_CNT, value)
}
func (soc *Socket) SetTcpKeepaliveIntvl(value int) error {
	return soc.setInt(C.ZMQ_TCP_KEEPALIVE_INTVL, value)
}
func (soc *Socket) SetTcpAcceptFilter(filter string) error {
	if len(filter) == 0 {
		return soc.setNullString(C.ZMQ_TCP_ACCEPT_FILTER)
	}
	return soc.setString(C.ZMQ_TCP_ACCEPT_FILTER, filter)
}
func (soc *Socket) SetPlainServer(value int) error {
	return soc.setInt(C.ZMQ_PLAIN_SERVER, value)
}
func (soc *Socket) SetPlainUsername(username string) error {
	if len(username) == 0 {
		return soc.setNullString(C.ZMQ_PLAIN_USERNAME)
	}
	return soc.setString(C.ZMQ_PLAIN_USERNAME, username)
}
func (soc *Socket) SetPlainPassword(password string) error {
	if len(password) == 0 {
		return soc.setNullString(C.ZMQ_PLAIN_PASSWORD)
	}
	return soc.setString(C.ZMQ_PLAIN_PASSWORD, password)
}
func (soc *Socket) SetCurveServer(value int) error {
	return soc.setInt(C.ZMQ_CURVE_SERVER, value)
}
func (soc *Socket) SetCurvePublickey(key string) error {
	return soc.setString(C.ZMQ_CURVE_PUBLICKEY, key)
}
func (soc *Socket) SetCurveSecretkey(key string) error {
	return soc.setString(C.ZMQ_CURVE_SECRETKEY, key)
}
func (soc *Socket) SetCurveServerkey(key string) error {
	return soc.setString(C.ZMQ_CURVE_SERVERKEY, key)
}
func (soc *Socket) SetZapDomain(domain string) error {
	return soc.setString(C.ZMQ_ZAP_DOMAIN, domain)
}
func (soc *Socket) SetConflate(value bool) error {
	val := 0
	if value {
		val = 1
	}
	return soc.setInt(C.ZMQ_CONFLATE, val)
}
func (soc *Socket) SetRouterHandover(value bool) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	val := 0
	if value {
		val = 1
	}
	return soc.setInt(C.ZMQ_ROUTER_HANDOVER, val)
}
func (soc *Socket) SetTos(value int) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	return soc.setInt(C.ZMQ_TOS, value)
}
func (soc *Socket) SetConnectRid(value string) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	if value == "" {
		return soc.setNullString(C.ZMQ_CONNECT_RID)
	}
	return soc.setString(C.ZMQ_CONNECT_RID, value)
}
func (soc *Socket) SetGssapiServer(value bool) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	val := 0
	if value {
		val = 1
	}
	return soc.setInt(C.ZMQ_GSSAPI_SERVER, val)
}
func (soc *Socket) SetGssapiPrincipal(value string) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	return soc.setString(C.ZMQ_GSSAPI_PRINCIPAL, value)
}
func (soc *Socket) SetGssapiServicePrincipal(value string) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	return soc.setString(C.ZMQ_GSSAPI_SERVICE_PRINCIPAL, value)
}
func (soc *Socket) SetGssapiPlaintext(value bool) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	val := 0
	if value {
		val = 1
	}
	return soc.setInt(C.ZMQ_GSSAPI_PLAINTEXT, val)
}
func (soc *Socket) SetHandshakeIvl(value time.Duration) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_HANDSHAKE_IVL, val)
}
func (soc *Socket) SetSocksProxy(value string) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	if value == "" {
		return soc.setNullString(C.ZMQ_SOCKS_PROXY)
	}
	return soc.setString(C.ZMQ_SOCKS_PROXY, value)
}
func (soc *Socket) SetXpubNodrop(value bool) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	val := 0
	if value {
		val = 1
	}
	return soc.setInt(C.ZMQ_XPUB_NODROP, val)
}
func (soc *Socket) SetXpubManual(value int) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return soc.setInt(C.ZMQ_XPUB_MANUAL, value)
}
func (soc *Socket) SetXpubWelcomeMsg(value string) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	if value == "" {
		return soc.setNullString(C.ZMQ_XPUB_WELCOME_MSG)
	}
	return soc.setString(C.ZMQ_XPUB_WELCOME_MSG, value)
}
func (soc *Socket) SetStreamNotify(value int) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return soc.setInt(C.ZMQ_STREAM_NOTIFY, value)
}
func (soc *Socket) SetInvertMatching(value int) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return soc.setInt(C.ZMQ_INVERT_MATCHING, value)
}
func (soc *Socket) SetHeartbeatIvl(value time.Duration) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_HEARTBEAT_IVL, val)
}
func (soc *Socket) SetHeartbeatTtl(value time.Duration) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_HEARTBEAT_TTL, val)
}
func (soc *Socket) SetHeartbeatTimeout(value time.Duration) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_HEARTBEAT_TIMEOUT, val)
}
func (soc *Socket) SetXpubVerboser(value int) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return soc.setInt(C.ZMQ_XPUB_VERBOSER, value)
}
func (soc *Socket) SetConnectTimeout(value time.Duration) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_CONNECT_TIMEOUT, val)
}
func (soc *Socket) SetTcpMaxrt(value time.Duration) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	val := int(value / time.Millisecond)
	return soc.setInt(C.ZMQ_TCP_MAXRT, val)
}
func (soc *Socket) SetMulticastMaxtpdu(value int) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return soc.setInt(C.ZMQ_MULTICAST_MAXTPDU, value)
}
func (soc *Socket) SetVmciBufferSize(value uint64) error {
	if minor < 2 {
		return ErrorNotImplemented42
	}
	return soc.setUInt64(C.ZMQ_VMCI_BUFFER_SIZE, value)
}