Exemple #1
0
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
}
Exemple #2
0
func (a *ENetAddress) SetPort(port uint) {
	a.port = C.enet_uint16(port)
}