这篇教程C++ wait_for_until函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wait_for_until函数的典型用法代码示例。如果您正苦于以下问题:C++ wait_for_until函数的具体用法?C++ wait_for_until怎么用?C++ wait_for_until使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wait_for_until函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: simple_publish_with_expirestatic void simple_publish_with_expire(int expires) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneProxyConfig* proxy; LinphonePresenceModel* presence; LinphoneCoreVTable *vtable = linphone_core_v_table_new(); vtable->publish_state_changed = linphone_publish_state_changed; _linphone_core_add_listener(marie->lc, vtable, TRUE, TRUE ); proxy = linphone_core_get_default_proxy_config(marie->lc); linphone_proxy_config_edit(proxy); if (expires >0) { linphone_proxy_config_set_publish_expires(proxy,expires); } linphone_proxy_config_enable_publish(proxy,TRUE); linphone_proxy_config_done(proxy); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,1)); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,1)); presence =linphone_presence_model_new_with_activity(LinphonePresenceActivityOffline,NULL); linphone_core_set_presence_model(marie->lc,presence); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,2)); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,2)); linphone_proxy_config_edit(proxy); linphone_proxy_config_done(proxy); /*make sure no publish is sent*/ BC_ASSERT_FALSE(wait_for_until(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,3,2000)); linphone_proxy_config_edit(proxy); linphone_proxy_config_enable_publish(proxy,FALSE); linphone_proxy_config_done(proxy); /*fixme PUBLISH state machine is too simple, clear state should only be propagated at API level when 200ok is received*/ /*BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,3));*/ wait_for_until(marie->lc,marie->lc,NULL,0,2000); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishCleared,1)); linphone_proxy_config_edit(proxy); linphone_proxy_config_enable_publish(proxy,TRUE); linphone_proxy_config_done(proxy); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,3)); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,3)); linphone_proxy_config_edit(proxy); linphone_proxy_config_set_publish_expires(proxy, linphone_proxy_config_get_publish_expires(proxy)+1); linphone_proxy_config_done(proxy); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,4)); BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,4)); linphone_core_manager_destroy(marie); /*fixme we should wait untill 200okBC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,2,int,"%i");*/ BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,4,int,"%i");}
开发者ID:CTA,项目名称:linphone,代码行数:57,
示例2: test_subscribe_notify_publishstatic void test_subscribe_notify_publish(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); LinphoneProxyConfig* proxy; LinphonePresenceModel* presence; LpConfig *pauline_lp = linphone_core_get_config(pauline->lc); char* lf_identity=linphone_address_as_string_uri_only(marie->identity); LinphoneFriend *lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity); lp_config_set_int(pauline_lp,"sip","subscribe_expires",5); linphone_core_add_friend(pauline->lc,lf); /*wait for subscribe acknowledgment*/ wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,1,2000); CU_ASSERT_EQUAL(LinphoneStatusOffline,linphone_friend_get_status(lf)); /*enable publish*/ linphone_core_get_default_proxy(marie->lc,&proxy); linphone_proxy_config_edit(proxy); linphone_proxy_config_enable_publish(proxy,TRUE); linphone_proxy_config_set_publish_expires(proxy,3); linphone_proxy_config_done(proxy); /*wait for marie status*/ wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,2,2000); CU_ASSERT_EQUAL(LinphoneStatusOnline,linphone_friend_get_status(lf)); presence =linphone_presence_model_new_with_activity(LinphonePresenceActivityBusy,NULL); linphone_core_set_presence_model(marie->lc,presence); /*wait for new status*/ wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,3,2000); CU_ASSERT_EQUAL(LinphoneStatusBusy,linphone_friend_get_status(lf)); /*wait for refresh*/ wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,4,5000); CU_ASSERT_EQUAL(LinphoneStatusBusy,linphone_friend_get_status(lf)); /*linphone_core_remove_friend(pauline->lc,lf);*/ /*wait for final notify*/ /*wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_NotifyReceived,4,5000); CU_ASSERT_EQUAL(LinphonePresenceActivityOffline,linphone_friend_get_status(lf)); */ linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline);}
开发者ID:Aditya-Jadoun,项目名称:linphone,代码行数:51,
示例3: carddav_cleanstatic void carddav_clean(void) { // This is to ensure the content of the test addressbook is in the correct state for the following tests LinphoneCoreManager *manager = linphone_core_manager_new2("carddav_rc", FALSE); LinphoneFriendList *lfl = linphone_core_create_friend_list(manager->lc); LinphoneFriendListCbs *cbs = linphone_friend_list_get_callbacks(lfl); LinphoneCardDAVStats *stats = (LinphoneCardDAVStats *)ms_new0(LinphoneCardDAVStats, 1); bctbx_list_t *friends = NULL; bctbx_list_t *friends_iterator = NULL; LinphoneFriend *lf = NULL; LinphoneVcard *lvc = NULL; linphone_friend_list_cbs_set_user_data(cbs, stats); linphone_friend_list_cbs_set_contact_created(cbs, carddav_contact_created); linphone_friend_list_cbs_set_contact_deleted(cbs, carddav_contact_deleted); linphone_friend_list_cbs_set_contact_updated(cbs, carddav_contact_updated); linphone_friend_list_cbs_set_sync_status_changed(cbs, carddav_sync_status_changed); linphone_core_add_friend_list(manager->lc, lfl); linphone_friend_list_set_uri(lfl, CARDDAV_SERVER); linphone_friend_list_synchronize_friends_from_server(lfl); wait_for_until(manager->lc, NULL, &stats->sync_done_count, 1, 5000); BC_ASSERT_EQUAL(stats->sync_done_count, 1, int, "%i"); stats->sync_done_count = 0; friends = bctbx_list_copy(lfl->friends); friends_iterator = friends; while (friends_iterator) { LinphoneFriend *lf = (LinphoneFriend *)friends_iterator->data; linphone_friend_list_remove_friend(lfl, lf); wait_for_until(manager->lc, NULL, &stats->sync_done_count, 1, 5000); BC_ASSERT_EQUAL(stats->sync_done_count, 1, int, "%i"); stats->sync_done_count = 0; stats->removed_contact_count = 0; friends_iterator = bctbx_list_next(friends_iterator); } bctbx_list_free(friends); lvc = linphone_vcard_context_get_vcard_from_buffer(manager->lc->vcard_context, "BEGIN:VCARD/r/nVERSION:4.0/r/nFN:Sylvain Berfini/r/nIMPP:sip:[email C++ wait_handshake函数代码示例 C++ wait_for_pid函数代码示例
|