示例#1
0
文件: addr.go 项目: zchee/gouv
func Ip4Addr(host string, port uint16) (SockaddrIn, error) {
	phost := C.CString(host)
	defer C.free(unsafe.Pointer(phost))
	var addr C.struct_sockaddr_in
	addr = C.uv_ip4_addr(phost, C.int(port))
	return &SockaddrIn4{addr}, nil
}
示例#2
0
文件: addr.go 项目: JeanSebTr/go-uv
func Ip4Addr(host string, port uint16) SockaddrIn {
	phost := C.CString(host)
	defer C.free(unsafe.Pointer(phost))
	return &SockaddrIn4{C.uv_ip4_addr(phost, C.int(port))}
}