func (soc *Socket) GetRcvbuf(value int) (uint64, error) {
	return soc.getUInt64(C.ZMQ_RCVBUF)
}
ZMQ_RCVBUF: Retrieve kernel receive buffer size

See: http://api.zeromq.org/2-2:zmq-getsockopt#toc16
package zmq2
import "C"
import (
	"strings"
	"time"
	"unsafe"
)
func (soc *Socket) getString(opt C.int, bufsize int) (string, error) {
	if !soc.opened {
		return "", ErrorSocketClosed
	}
	value := make([]byte, bufsize)
	size := C.size_t(bufsize)
	if i, err := C.zmq_getsockopt(soc.soc, opt, unsafe.Pointer(&value[0]), &size); i != 0 {
		return "", errget(err)
	}
	return strings.TrimRight(string(value[:int(size)]), "\x00"), nil
}
func (soc *Socket) getInt(opt C.int) (int, error) {
	if !soc.opened {
		return 0, ErrorSocketClosed
	}
	value := C.int(0)
	size := C.size_t(unsafe.Sizeof(value))
	if i, err := C.zmq_getsockopt(soc.soc, opt, unsafe.Pointer(&value), &size); i != 0 {
		return 0, errget(err)
	}
	return int(value), nil
}
func (soc *Socket) getInt64(opt C.int) (int64, error) {
	if !soc.opened {
		return 0, ErrorSocketClosed
	}
	value := C.int64_t(0)
	size := C.size_t(unsafe.Sizeof(value))
	if i, err := C.zmq_getsockopt(soc.soc, opt, unsafe.Pointer(&value), &size); i != 0 {
		return 0, errget(err)
	}
	return int64(value), nil
}
func (soc *Socket) getUInt64(opt C.int) (uint64, error) {
	if !soc.opened {
		return 0, ErrorSocketClosed
	}
	value := C.uint64_t(0)
	size := C.size_t(unsafe.Sizeof(value))
	if i, err := C.zmq_getsockopt(soc.soc, opt, unsafe.Pointer(&value), &size); i != 0 {
		return 0, errget(err)
	}
	return uint64(value), nil
}
func (soc *Socket) getUInt32(opt C.int) (uint32, error) {
	if !soc.opened {
		return 0, ErrorSocketClosed
	}
	value := C.uint32_t(0)
	size := C.size_t(unsafe.Sizeof(value))
	if i, err := C.zmq_getsockopt(soc.soc, opt, unsafe.Pointer(&value), &size); i != 0 {
		return 0, errget(err)
	}
	return uint32(value), nil
}
func (soc *Socket) GetType() (Type, error) {
	v, err := soc.getInt(C.ZMQ_TYPE)
	return Type(v), err
}
func (soc *Socket) GetRcvmore() (bool, error) {
	v, err := soc.getInt64(C.ZMQ_RCVMORE)
	return v != 0, err
}
func (soc *Socket) GetHwm() (uint64, error) {
	return soc.getUInt64(C.ZMQ_HWM)
}
func (soc *Socket) GetRcvtimeo() (time.Duration, error) {
	major, minor, _ := Version()
	if major == 2 && minor < 2 {
		return 0, ErrorNotImplemented
	}
	v, err := soc.getInt(C.ZMQ_RCVTIMEO)
	if v < 0 {
		return time.Duration(-1), err
	}
	return time.Duration(v) * time.Millisecond, err
}
func (soc *Socket) GetSndtimeo() (time.Duration, error) {
	major, minor, _ := Version()
	if major == 2 && minor < 2 {
		return 0, ErrorNotImplemented
	}
	v, err := soc.getInt(C.ZMQ_SNDTIMEO)
	if v < 0 {
		return time.Duration(-1), err
	}
	return time.Duration(v) * time.Millisecond, err
}
func (soc *Socket) GetSwap() (int64, error) {
	return soc.getInt64(C.ZMQ_SWAP)
}
func (soc *Socket) GetAffinity() (uint64, error) {
	return soc.getUInt64(C.ZMQ_AFFINITY)
}
func (soc *Socket) GetIdentity() (string, error) {
	return soc.getString(C.ZMQ_IDENTITY, 256)
}
func (soc *Socket) GetRate() (int64, error) {
	return soc.getInt64(C.ZMQ_RATE)
}
func (soc *Socket) GetRecoveryIvl() (time.Duration, error) {
	v, e := soc.getInt64(C.ZMQ_RECOVERY_IVL)
	return time.Duration(v) * time.Second, e
}
func (soc *Socket) GetRecoveryIvlMsec() (time.Duration, error) {
	v, e := soc.getInt64(C.ZMQ_RECOVERY_IVL_MSEC)
	if v == -1 {
		return -1, e
	}
	return time.Duration(v) * time.Millisecond, e
}
func (soc *Socket) GetMcastLoop() (bool, error) {
	v, e := soc.getInt64(C.ZMQ_MCAST_LOOP)
	if v == 0 {
		return false, e
	}
	return true, e
}
func (soc *Socket) GetSndbuf(value int) (uint64, error) {
	return soc.getUInt64(C.ZMQ_SNDBUF)
}