public int Service(int timeout) { if (timeout < 0) { throw new ArgumentOutOfRangeException("timeout"); } CheckCreated(); return(Native.enet_host_service(_host, null, (uint)timeout)); }
public int Service(int timeout, out Event @event) { if (timeout < 0) { throw new ArgumentOutOfRangeException("timeout"); } CheckCreated(); Native.ENetEvent nativeEvent; var ret = Native.enet_host_service(_host, out nativeEvent, (uint)timeout); if (ret <= 0) { @event = new Event(); return(ret); } @event = new Event(nativeEvent); return(ret); }
public int Service(int timeout, out Event @event) { if (timeout < 0) { throw new ArgumentOutOfRangeException("timeout"); } ThrowIfNotCreated(); ENetEvent nativeEvent; var result = Native.enet_host_service(nativeHost, out nativeEvent, (uint)timeout); if (result <= 0) { @event = default(Event); return(result); } @event = new Event(nativeEvent); return(result); }