func (soc *Socket) GetCurveServerkeyRaw() (string, error) {
	return soc.getStringRaw(C.ZMQ_CURVE_SERVERKEY, 32)
}
ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key

See: http://api.zeromq.org/4-1:zmq-getsockopt#toc7
package zmq4
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)
	var i C.int
	var err error
	for {
		i, err = C.zmq4_getsockopt(soc.soc, opt, unsafe.Pointer(&value[0]), &size)
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return "", errget(err)
	}
	return strings.TrimRight(string(value[:int(size)]), "\x00"), nil
}
func (soc *Socket) getStringRaw(opt C.int, bufsize int) (string, error) {
	if !soc.opened {
		return "", ErrorSocketClosed
	}
	value := make([]byte, bufsize)
	size := C.size_t(bufsize)
	var i C.int
	var err error
	for {
		i, err = C.zmq4_getsockopt(soc.soc, opt, unsafe.Pointer(&value[0]), &size)
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return "", errget(err)
	}
	return string(value[:int(size)]), 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))
	var i C.int
	var err error
	for {
		i, err = C.zmq4_getsockopt(soc.soc, opt, unsafe.Pointer(&value), &size)
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if 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))
	var i C.int
	var err error
	for {
		i, err = C.zmq4_getsockopt(soc.soc, opt, unsafe.Pointer(&value), &size)
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if 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))
	var i C.int
	var err error
	for {
		i, err = C.zmq4_getsockopt(soc.soc, opt, unsafe.Pointer(&value), &size)
		if i == 0 || !soc.ctx.retry(err) {
			break
		}
	}
	if i != 0 {
		return 0, errget(err)
	}
	return uint64(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.getInt(C.ZMQ_RCVMORE)
	return v != 0, err
}
func (soc *Socket) GetSndhwm() (int, error) {
	return soc.getInt(C.ZMQ_SNDHWM)
}
func (soc *Socket) GetRcvhwm() (int, error) {
	return soc.getInt(C.ZMQ_RCVHWM)
}
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() (int, error) {
	return soc.getInt(C.ZMQ_RATE)
}
func (soc *Socket) GetRecoveryIvl() (time.Duration, error) {
	v, err := soc.getInt(C.ZMQ_RECOVERY_IVL)
	return time.Duration(v) * time.Millisecond, err
}
func (soc *Socket) GetSndbuf() (int, error) {
	return soc.getInt(C.ZMQ_SNDBUF)
}
func (soc *Socket) GetRcvbuf() (int, error) {
	return soc.getInt(C.ZMQ_RCVBUF)
}
func (soc *Socket) GetLinger() (time.Duration, error) {
	v, err := soc.getInt(C.ZMQ_LINGER)
	if v < 0 {
		return time.Duration(-1), err
	}
	return time.Duration(v) * time.Millisecond, err
}
func (soc *Socket) GetReconnectIvl() (time.Duration, error) {
	v, err := soc.getInt(C.ZMQ_RECONNECT_IVL)
	if v < 0 {
		return time.Duration(-1), err
	}
	return time.Duration(v) * time.Millisecond, err
}
func (soc *Socket) GetReconnectIvlMax() (time.Duration, error) {
	v, err := soc.getInt(C.ZMQ_RECONNECT_IVL_MAX)
	return time.Duration(v) * time.Millisecond, err
}
func (soc *Socket) GetBacklog() (int, error) {
	return soc.getInt(C.ZMQ_BACKLOG)
}
func (soc *Socket) GetMaxmsgsize() (int64, error) {
	return soc.getInt64(C.ZMQ_MAXMSGSIZE)
}
func (soc *Socket) GetMulticastHops() (int, error) {
	return soc.getInt(C.ZMQ_MULTICAST_HOPS)
}
func (soc *Socket) GetRcvtimeo() (time.Duration, error) {
	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) {
	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) GetIpv6() (bool, error) {
	v, err := soc.getInt(C.ZMQ_IPV6)
	return v != 0, err
}
func (soc *Socket) GetImmediate() (bool, error) {
	v, err := soc.getInt(C.ZMQ_IMMEDIATE)
	return v != 0, err
}
func (soc *Socket) GetEvents() (State, error) {
	v, err := soc.getInt(C.ZMQ_EVENTS)
	return State(v), err
}
func (soc *Socket) GetLastEndpoint() (string, error) {
	return soc.getString(C.ZMQ_LAST_ENDPOINT, 1024)
}
func (soc *Socket) GetTcpKeepalive() (int, error) {
	return soc.getInt(C.ZMQ_TCP_KEEPALIVE)
}
func (soc *Socket) GetTcpKeepaliveIdle() (int, error) {
	return soc.getInt(C.ZMQ_TCP_KEEPALIVE_IDLE)
}
func (soc *Socket) GetTcpKeepaliveCnt() (int, error) {
	return soc.getInt(C.ZMQ_TCP_KEEPALIVE_CNT)
}
func (soc *Socket) GetTcpKeepaliveIntvl() (int, error) {
	return soc.getInt(C.ZMQ_TCP_KEEPALIVE_INTVL)
}
func (soc *Socket) GetMechanism() (Mechanism, error) {
	v, err := soc.getInt(C.ZMQ_MECHANISM)
	return Mechanism(v), err
}
func (soc *Socket) GetPlainServer() (int, error) {
	return soc.getInt(C.ZMQ_PLAIN_SERVER)
}
func (soc *Socket) GetPlainUsername() (string, error) {
	s, err := soc.getString(C.ZMQ_PLAIN_USERNAME, 1024)
	if n := len(s); n > 0 && s[n-1] == 0 {
		s = s[:n-1]
	}
	return s, err
}
func (soc *Socket) GetPlainPassword() (string, error) {
	s, err := soc.getString(C.ZMQ_PLAIN_PASSWORD, 1024)
	if n := len(s); n > 0 && s[n-1] == 0 {
		s = s[:n-1]
	}
	return s, err
}
func (soc *Socket) GetCurvePublickeyRaw() (string, error) {
	return soc.getStringRaw(C.ZMQ_CURVE_PUBLICKEY, 32)
}
func (soc *Socket) GetCurvePublickeykeyZ85() (string, error) {
	return soc.getString(C.ZMQ_CURVE_PUBLICKEY, 41)
}
func (soc *Socket) GetCurveSecretkeyRaw() (string, error) {
	return soc.getStringRaw(C.ZMQ_CURVE_SECRETKEY, 32)
}
func (soc *Socket) GetCurveSecretkeyZ85() (string, error) {
	return soc.getString(C.ZMQ_CURVE_SECRETKEY, 41)
}