Пример #1
0
static VALUE
switch_start_chibach( VALUE self ) {
  struct itimerspec interval;
  interval.it_interval.tv_sec = 0;
  interval.it_interval.tv_nsec = 1000000;
  interval.it_value.tv_sec = 0;
  interval.it_value.tv_nsec = 0;
  add_timer_event_callback( &interval, thread_pass, NULL );

  start_chibach();

  return self;
}
Пример #2
0
int
main( int argc, char **argv ) {
    init_chibach( &argc, &argv );

    set_hello_handler( handle_hello, NULL );
    set_features_request_handler( handle_features_request, NULL );
    set_echo_request_handler( handle_echo_request, NULL );

    start_chibach();

    stop_chibach();

    return 0;
}