Module: Racer

Defined in:
lib/racer/version.rb,
ext/racer/racer.c

Defined Under Namespace

Modules: Stats

Constant Summary collapse

VERSION =
"0.1.3"

Class Method Summary collapse

Class Method Details

.run(v_address, v_port, app) ⇒ Object



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'ext/racer/racer.c', line 467

static VALUE Racer_run(VALUE self, VALUE v_address, VALUE v_port, VALUE app)
{
    if(loop) {
        rb_raise(rb_eRuntimeError, "Racer instance already running");
    }
    long _port = FIX2INT(v_port);
    if(_port <= 0 || _port >= 65536) {
        // out of range
        rb_raise(rb_eArgError, "port number outside valid range");
    }
    char* addr_str = rb_string_value_cstr(&v_address);
    port = (uint16_t)_port;
    struct sockaddr_in addr = uv_ip4_addr(addr_str, port);
    run(addr, app);
    return Qnil;
}