示例#1
0
static void server_init_call_elem(grpc_call_element* elem,
                                  const void* server_transport_data) {
  call_data* d = elem->call_data;
  GPR_ASSERT(d != NULL);
  init_rpc_stats(&d->stats);
  d->start_ts = gpr_now();
  d->op_id = census_tracing_start_op();
}
示例#2
0
文件: mtdispatch.C 项目: Keloran/okws
void 
mtdispatch_t::init ()
{

  init_rpc_stats ();

  int fds[2];

  if (num == 0) {
    warn << "Cannot start program with 0 threads; exiting...\n";
    exit (3);
  }

  if (pipe (fds) < 0)
    fatal << "mtdispatch::init: cannot open pipe\n";
  fdin = fds[0];
  make_async (fdin);
  fdcb (fdin, selread, wrap (this, &mtdispatch_t::chld_msg));
  for (u_int i = 0; i < num; i++) {
    launch (i, fds[1]);
  }
  //close (fds[1]);
}