func (soc *Socket) GetTcpKeepalive() (int, error) {
	return soc.getInt(C.ZMQ_TCP_KEEPALIVE)
}
ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option

See: http://api.zeromq.org/4-1:zmq-getsockopt#toc38
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)
}