这篇教程C++ uv_timer_start函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uv_timer_start函数的典型用法代码示例。如果您正苦于以下问题:C++ uv_timer_start函数的具体用法?C++ uv_timer_start怎么用?C++ uv_timer_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uv_timer_start函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main(int argc, char **argv){ printf("libuev../r/n"); xloop = uv_default_loop();// uv_loop_init(&xloop); uv_watch_init(xloop, &watch1); uv_watch_start(&watch1, watch1_func, get_state, 5010); uv_timer_init(xloop, &timer1); uv_timer_start(&timer1, time1_func, 1000, 1000); uv_timer_init(xloop, &timer2); uv_timer_start(&timer2, time2_func, 5011, 0); // uv_timer_init(xloop, &timer3);// uv_timer_start(&timer3, time3_func, 0, 5000); // uv_timer_init(xloop, &timer4);// uv_timer_start(&timer4, time4_func, 5000, 0); uv_run(xloop);}
开发者ID:0x1abin,项目名称:FMCU,代码行数:25,
示例2: poll_cbstatic void poll_cb(uv_fs_poll_t* handle, int status, const uv_stat_t* prev, const uv_stat_t* curr) { uv_stat_t zero_statbuf; memset(&zero_statbuf, 0, sizeof(zero_statbuf)); ASSERT(handle == &poll_handle); ASSERT(1 == uv_is_active((uv_handle_t*) handle)); ASSERT(prev != NULL); ASSERT(curr != NULL); switch (poll_cb_called++) { case 0: ASSERT(status == UV_ENOENT); ASSERT(0 == memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); ASSERT(0 == memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); touch_file(FIXTURE); break; case 1: ASSERT(status == 0); ASSERT(0 == memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); ASSERT(0 != memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 20, 0)); break; case 2: ASSERT(status == 0); ASSERT(0 != memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); ASSERT(0 != memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 200, 0)); break; case 3: ASSERT(status == 0); ASSERT(0 != memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); ASSERT(0 != memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); remove(FIXTURE); break; case 4: ASSERT(status == UV_ENOENT); ASSERT(0 != memcmp(prev, &zero_statbuf, sizeof(zero_statbuf))); ASSERT(0 == memcmp(curr, &zero_statbuf, sizeof(zero_statbuf))); uv_close((uv_handle_t*)handle, close_cb); break; default: ASSERT(0); }}
开发者ID:1048046563,项目名称:node,代码行数:53,
示例3: Initializevoid Initialize(){ uv_timer_init(uv_default_loop(), &G_ThreadTimer); G_pGateCore = new class CGateCore(); if (G_pGateCore->bInit() == false) { std::fprintf(stderr, "ERROR: Init fail!/n"); std::exit(1); return; } G_pListenSock = new class XSocket(300); if (!G_pListenSock->bListen(G_pGateCore->m_cGateServerAddr, G_pGateCore->m_iGateServerPort, WM_USER_ACCEPT)) { OnDestroy(); std::exit(1); return; } // C++ uv_timer_stop函数代码示例 C++ uv_timer_init函数代码示例
|