Beispiel #1
0
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
}
Beispiel #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))}
}