ext/iodine/iodine_connection.c
/**
 * Sets the timeout / `ping` interval for the connection (up to 255 seconds).
 *
 * Returns nil on error.
 */
Sets the timeout / `ping` interval for the connection (up to 255 seconds).
Returns nil on error.
Sets the timeout / ` ping ` interval for the connection ( up to 255 seconds ) . Returns nil on error .
static VALUE iodine_connection_timeout_set(VALUE self, VALUE timeout) {
  Check_Type(timeout, T_FIXNUM);
  int tout = NUM2INT(timeout);
  if (tout < 0 || tout > 255) {
    rb_raise(rb_eRangeError, "timeout out of range.");
    return Qnil;
  }
  iodine_connection_data_s *c = iodine_connection_validate_data(self);
  if (c && !fio_is_closed(c->info.uuid)) {
    fio_timeout_set(c->info.uuid, (uint8_t)tout);
    return timeout;
  }
  return Qnil;
}
static VALUE iodine_connection_timeout_set ( VALUE self , VALUE timeout ) { Check_Type ( timeout , T_FIXNUM ) ; int tout = NUM2INT ( timeout ) ; if ( tout < 0 || tout > 255 ) { rb_raise ( rb_eRangeError , " " ) ; return Qnil ; } iodine_connection_data_s * c = iodine_connection_validate_data ( self ) ; if ( c && ! fio_is_closed ( c -> info . uuid ) ) { fio_timeout_set ( c -> info . uuid , ( uint8_t ) tout ) ; return timeout ; } return Qnil ; }
Sets the timeout / `ping` interval for the connection (up to 255 seconds).
Sets the timeout / ` ping ` interval for the connection ( up to 255 seconds ) .