/** Set the in and out speeds of a host in Bytes per second. **/ static value udpr_setrate(value o, value in, value out) { if( !val_is_abstract(o) || !val_is_kind(o,k_udprhost) ) neko_error(); enet_host_bandwidth_limit((ENetHost *)val_data(o), (enet_uint32)val_int32(in), (enet_uint32)val_int32(out)); return val_true; }
void setrate(int rate) { if(!curpeer) return; enet_host_bandwidth_limit(clienthost, rate*1024, rate*1024); }