func conv_addr(address *net.UDPAddr) (c_addr C.ENetAddress) { c_ip := C.CString(address.IP.String()) defer C.free(unsafe.Pointer(c_ip)) C.enet_address_set_host(&c_addr, c_ip) c_addr.port = C.enet_uint16(address.Port) return }
func (a *ENetAddress) SetHostName(hostName string) int { hName := C.CString(hostName) defer C.free(unsafe.Pointer(hName)) return int(C.enet_address_set_host((*C.ENetAddress)(a), hName)) }