Example #1
0
File: addr.go Project: 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
}
Example #2
0
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))}
}