func (soc *Socket) SetRcvbuf(value uint64) error {
	return soc.setUInt64(C.ZMQ_RCVBUF, value)
}
ZMQ_RCVBUF: Set kernel receive buffer size

See: http://api.zeromq.org/2-2:zmq-setsockopt#toc16
package zmq2
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))
	if i, err := C.zmq_setsockopt(soc.soc, opt, unsafe.Pointer(cs), C.size_t(len(s))); 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)
	if i, err := C.zmq_setsockopt(soc.soc, opt, unsafe.Pointer(&val), C.size_t(unsafe.Sizeof(val))); 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)
	if i, err := C.zmq_setsockopt(soc.soc, opt, unsafe.Pointer(&val), C.size_t(unsafe.Sizeof(val))); 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)
	if i, err := C.zmq_setsockopt(soc.soc, opt, unsafe.Pointer(&val), C.size_t(unsafe.Sizeof(val))); i != 0 {
		return errget(err)
	}
	return nil
}
func (soc *Socket) SetHwm(value uint64) error {
	return soc.setUInt64(C.ZMQ_HWM, value)
}
func (soc *Socket) SetSwap(value int64) error {
	return soc.setInt64(C.ZMQ_SWAP, value)
}
func (soc *Socket) SetAffinity(value uint64) error {
	return soc.setUInt64(C.ZMQ_AFFINITY, value)
}
func (soc *Socket) SetIdentity(value string) error {
	return soc.setString(C.ZMQ_IDENTITY, 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) SetRcvtimeo(value time.Duration) error {
	major, minor, _ := Version()
	if major == 2 && minor < 2 {
		return ErrorNotImplemented
	}
	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 {
	major, minor, _ := Version()
	if major == 2 && minor < 2 {
		return ErrorNotImplemented
	}
	val := int(value / time.Millisecond)
	if value == -1 {
		val = -1
	}
	return soc.setInt(C.ZMQ_SNDTIMEO, val)
}
func (soc *Socket) SetRate(value int64) error {
	return soc.setInt64(C.ZMQ_RATE, value)
}
func (soc *Socket) SetRecoveryIvl(value time.Duration) error {
	val := int64(value / time.Second)
	return soc.setInt64(C.ZMQ_RECOVERY_IVL, val)
}
func (soc *Socket) SetRecoveryIvlMsec(value time.Duration) error {
	val := int64(value / time.Millisecond)
	if value < 0 {
		val = -1
	}
	return soc.setInt64(C.ZMQ_RECOVERY_IVL_MSEC, val)
}
func (soc *Socket) SetMcastLoop(value bool) error {
	val := int64(0)
	if value {
		val = 1
	}
	return soc.setInt64(C.ZMQ_MCAST_LOOP, val)
}
func (soc *Socket) SetSndbuf(value uint64) error {
	return soc.setUInt64(C.ZMQ_SNDBUF, value)
}