Esempio n. 1
0
// enet_host_service
func (host *Host) Service(timeout time.Duration) (*Event, error) {
	if timeout < 0 {
		return nil, errors.New("Timeout duration was negative")
	}

	var c_event C.ENetEvent

	ret := C.enet_host_service(host.host, &c_event, C.enet_uint32(timeout/time.Millisecond))

	return host.ret_to_error(&c_event, ret)
}
Esempio n. 2
0
File: host.go Progetto: boj/goenet
func (h *ENetHost) Service(event *ENetEvent, timeout int) int {
	return int(C.enet_host_service((*C.ENetHost)(h), (*C.ENetEvent)(event), C.enet_uint32(timeout)))
}