Class: IOExt

Inherits:
Object
  • Object
show all
Defined in:
lib/ioext.rb,
lib/ioext/version.rb,
ext/ioext/ioext.c

Defined Under Namespace

Classes: Error

Constant Summary collapse

VERSION =
"0.1.1"
IOB_ENTRIES =
LONG2NUM(_IOB_ENTRIES)

Instance Method Summary collapse

Constructor Details

#initializeObject



35
36
37
38
# File 'ext/ioext/ioext.c', line 35

static VALUE
ioext_initialize(VALUE self) {
  return Qnil;
}

Instance Method Details

#maxstdioObject



40
41
42
43
# File 'ext/ioext/ioext.c', line 40

static VALUE 
ioext_maxstdio(VALUE self) {
  return INT2NUM(_getmaxstdio());
}

#maxstdio=(newmaxfd) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'ext/ioext/ioext.c', line 45

static VALUE 
ioext_set_maxstdio(VALUE self, VALUE newmaxfd) {
  DWORD ret = 0;
  const int fdlimit = 2048;

  if (NUM2INT(newmaxfd) < 0) {
    rb_raise(rb_eArgError, "max fd must not negative");
  }

  ret = _setmaxstdio(min(NUM2INT(newmaxfd), fdlimit));

  return INT2NUM(ret);
}

#set_maxstdio(newmaxfd) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'ext/ioext/ioext.c', line 45

static VALUE 
ioext_set_maxstdio(VALUE self, VALUE newmaxfd) {
  DWORD ret = 0;
  const int fdlimit = 2048;

  if (NUM2INT(newmaxfd) < 0) {
    rb_raise(rb_eArgError, "max fd must not negative");
  }

  ret = _setmaxstdio(min(NUM2INT(newmaxfd), fdlimit));

  return INT2NUM(ret);
}