mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-05 05:07:38 +08:00
27 lines
473 B
Go
27 lines
473 B
Go
// +build windows
|
|
|
|
package zmq4
|
|
|
|
/*
|
|
#include <zmq.h>
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
/*
|
|
ZMQ_FD: Retrieve file descriptor associated with the socket
|
|
|
|
See: http://api.zeromq.org/4-1:zmq-getsockopt#toc9
|
|
*/
|
|
func (soc *Socket) GetFd() (uintptr, error) {
|
|
value := C.SOCKET(0)
|
|
size := C.size_t(unsafe.Sizeof(value))
|
|
if i, err := C.zmq_getsockopt(soc.soc, C.ZMQ_FD, unsafe.Pointer(&value), &size); i != 0 {
|
|
return uintptr(0), errget(err)
|
|
}
|
|
return uintptr(value), nil
|
|
}
|