这篇教程C++ DNSServiceRefDeallocate函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DNSServiceRefDeallocate函数的典型用法代码示例。如果您正苦于以下问题:C++ DNSServiceRefDeallocate函数的具体用法?C++ DNSServiceRefDeallocate怎么用?C++ DNSServiceRefDeallocate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DNSServiceRefDeallocate函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DNSServiceResolvebool CZeroconfBrowserWIN::doResolveService(CZeroconfBrowser::ZeroconfService& fr_service, double f_timeout){ DNSServiceErrorType err; DNSServiceRef sdRef = NULL; err = DNSServiceResolve(&sdRef, 0, kDNSServiceInterfaceIndexAny, fr_service.GetName(), fr_service.GetType(), fr_service.GetDomain(), ResolveCallback, &fr_service); if( err != kDNSServiceErr_NoError ) { if (sdRef) DNSServiceRefDeallocate(sdRef); CLog::Log(LOGERROR, "ZeroconfBrowserWIN: DNSServiceResolve returned (error = %ld)", (int) err); return false; } err = DNSServiceProcessResult(sdRef); if (err != kDNSServiceErr_NoError) CLog::Log(LOGERROR, "ZeroconfBrowserWIN::doResolveService DNSServiceProcessResult returned (error = %ld)", (int) err); if (sdRef) DNSServiceRefDeallocate(sdRef); return true;}
开发者ID:A600,项目名称:xbmc,代码行数:26,
示例2: lockvoid CZeroconfMDNS::doStop(){ { CSingleLock lock(m_data_guard); CLog::Log(LOGDEBUG, "ZeroconfMDNS: Shutdown services"); for(tServiceMap::iterator it = m_services.begin(); it != m_services.end(); ++it) { DNSServiceRefDeallocate(it->second.serviceRef); TXTRecordDeallocate(&it->second.txtRecordRef); CLog::Log(LOGDEBUG, "ZeroconfMDNS: Removed service %s", it->first.c_str()); } m_services.clear(); } { CSingleLock lock(m_data_guard);#if defined(TARGET_WINDOWS_STORE) CLog::Log(LOGERROR, "ZeroconfMDNS: WSAAsyncSelect not yet supported for TARGET_WINDOWS_STORE");#else WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( m_service ), g_hWnd, BONJOUR_EVENT, 0 );#endif //TARGET_WINDOWS if (m_service) DNSServiceRefDeallocate(m_service); m_service = NULL; }}
开发者ID:68foxboris,项目名称:xbmc,代码行数:26,
示例3: FreeOutAllvoid FreeOutAll(void){ struct connection_out *next = Outbound_Control.head; struct connection_out *now; Outbound_Control.head = NULL; Outbound_Control.active = 0; while (next) { now = next; next = now->next; LEVEL_DEBUG("Freeing outbound %s #%d",now->zero.name,now->index); SAFEFREE(now->zero.name) ; SAFEFREE(now->zero.type) ; SAFEFREE(now->zero.domain) ; SAFEFREE(now->name) ; SAFEFREE(now->host) ; SAFEFREE(now->service) ; if (now->ai) { freeaddrinfo(now->ai); now->ai = NULL; }#if OW_ZERO if (libdnssd != NULL) { if (now->sref0) { DNSServiceRefDeallocate(now->sref0); } if (now->sref1) { DNSServiceRefDeallocate(now->sref1); } }#endif owfree(now); }}
开发者ID:GrandHsu,项目名称:iicontrollibs,代码行数:34,
示例4: mainint main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) { DNSServiceRef ref1, ref2, ref3, ref4 = NULL; DNSServiceRegister(&ref1, 0, 0, "simple", "_simple._tcp", NULL, NULL, 4711, 0, NULL, NULL, NULL); DNSServiceRegister(&ref2, 0, 0, "subtype #1", "_simple._tcp,_subtype1", NULL, NULL, 4711, 0, NULL, NULL, NULL); DNSServiceRegister(&ref3, 0, 0, "subtype #2", "_simple._tcp,_subtype1,_subtype2", NULL, NULL, 4711, 0, NULL, NULL, NULL); DNSServiceRegister(&ref4, 0, 0, "subtype #3", "_simple._tcp,,", NULL, NULL, 4711, 0, NULL, NULL, NULL); assert(!ref4); DNSServiceRegister(&ref4, 0, 0, "subtype #3", "", NULL, NULL, 4711, 0, NULL, NULL, NULL); assert(!ref4); DNSServiceRegister(&ref4, 0, 0, "subtype #3", ",", NULL, NULL, 4711, 0, NULL, NULL, NULL); assert(!ref4); DNSServiceRegister(&ref4, 0, 0, "subtype #3", ",,", NULL, NULL, 4711, 0, NULL, NULL, NULL); assert(!ref4); DNSServiceBrowse(&ref4, 0, 0, "_simple._tcp,_gurke", NULL, reply, NULL); sleep(20); DNSServiceRefDeallocate(ref1); DNSServiceRefDeallocate(ref2); DNSServiceRefDeallocate(ref3); DNSServiceRefDeallocate(ref4); return 0;}
开发者ID:RidgeRun,项目名称:eval-sdk-imx6-hummingboard,代码行数:28,
示例5: player_sd_finivoidplayer_sd_fini(player_sd_t* sd){ int i; player_sd_mdns_t* mdns = (player_sd_mdns_t*)(sd->sdRef); if(mdns->browseRef_valid) { DNSServiceRefDeallocate(mdns->browseRef); mdns->browseRef_valid = 0; } for(i=0;i<mdns->mdnsDevs_len;i++) { if(mdns->mdnsDevs[i].valid) { DNSServiceRefDeallocate(mdns->mdnsDevs[i].regRef); mdns->mdnsDevs[i].valid = 0; } } pthread_mutex_destroy(&(mdns->mutex)); if(mdns->mdnsDevs) free(mdns->mdnsDevs); free(mdns); free(sd);}
开发者ID:brunoellll,项目名称:player-git-svn,代码行数:28,
示例6: WSAAsyncSelectOSStatusCConfigPropertySheet::TearDownBrowsing(){ OSStatus err = kNoErr; if ( m_browseDomainsRef ) { err = WSAAsyncSelect( DNSServiceRefSockFD( m_browseDomainsRef ), m_hWnd, 0, 0 ); check_noerr( err ); DNSServiceRefDeallocate( m_browseDomainsRef ); m_browseDomainsRef = NULL; } if ( m_regDomainsRef ) { err = WSAAsyncSelect( DNSServiceRefSockFD( m_regDomainsRef ), m_hWnd, 0, 0 ); check_noerr( err ); DNSServiceRefDeallocate( m_regDomainsRef ); m_regDomainsRef = NULL; } return err;}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:27,
示例7: TerminateGameServicevoid TerminateGameService() { if ( localServer ) { localServer = false; } DNSServiceRefDeallocate( serviceRef ); memset( serviceInterfaces, 0, sizeof( serviceInterfaces ) );}
开发者ID:KoalaWarfare,项目名称:DOOM-IOS2,代码行数:7,
示例8: mdns_main_freestatic intmdns_main_free(void){ struct mdns_service *s; struct mdns_browser *mb; struct mdns_record *r; for(s = mdns_services; mdns_services; s = mdns_services) { mdns_services = s->next; mdns_service_free(s); } for (mb = mdns_browsers; mdns_browsers; mb = mdns_browsers) { mdns_browsers = mb->next; mdns_browser_free(mb); } for (r = mdns_records; mdns_records; r = mdns_records) { mdns_records = r->next; mdns_record_free(r); } if(mdns_ev_main) event_free(mdns_ev_main); mdns_ev_main = NULL; if(mdns_sdref_main) DNSServiceRefDeallocate(mdns_sdref_main); mdns_sdref_main = NULL; return -1;}
开发者ID:ejurgensen,项目名称:forked-daapd,代码行数:34,
示例9: mdns_resolver_freestatic intmdns_resolver_free(struct mdns_resolver *rs) { struct mdns_addr_lookup *lu; if (! rs) return -1; /* free/cancel all lookups */ for(lu = rs->lookups; lu; lu = rs->lookups) { rs->lookups = lu->next; mdns_addr_lookup_free(lu); } if(rs->timer) event_free(rs->timer); if(rs->sdref) DNSServiceRefDeallocate(rs->sdref); free(rs->service); free(rs->regtype); free(rs->domain); free(rs); return -1;}
开发者ID:ejurgensen,项目名称:forked-daapd,代码行数:26,
示例10: OW_Browse_Bonjour// Called in a threadstatic void * OW_Browse_Bonjour(void * v){ struct connection_in * in = v ; DNSServiceErrorType dnserr; DETACH_THREAD; MONITOR_RLOCK ; dnserr = DNSServiceBrowse(&in->master.browse.bonjour_browse, 0, 0, "_owserver._tcp", NULL, BrowseBack, NULL); if (dnserr != kDNSServiceErr_NoError) { LEVEL_CONNECT("DNSServiceBrowse error = %d", dnserr); MONITOR_RUNLOCK ; return VOID_RETURN ; } // Blocks, which is why this is in it's own thread while (DNSServiceProcessResult(in->master.browse.bonjour_browse) == kDNSServiceErr_NoError) { //printf("DNSServiceProcessResult ref %ld/n",(long int)rs->sref) ; continue; } DNSServiceRefDeallocate(in->master.browse.bonjour_browse); in->master.browse.bonjour_browse = 0 ; MONITOR_RUNLOCK ; return VOID_RETURN;}
开发者ID:M-o-a-T,项目名称:owfs,代码行数:26,
示例11: registration void registration(Thread *thread) { // release calling thread semaphore thread->thread_ready(); DNSServiceErrorType error; DNSServiceRef service; error = DNSServiceRegister(&service, 0, // no flags 0, // all network interfaces master_->name_.c_str(), // name master_->service_type_.c_str(), // service type "", // register in default domain(s) NULL, // use default host name htons(master_->port_),// port number 0, // length of TXT record NULL, // no TXT record Implementation::register_callback, // callback function (void*)master_); // context if (error == kDNSServiceErr_NoError) { pthread_cleanup_push(registration_cleanup, &service); register_service(service); pthread_cleanup_pop(0); // 0 = do not execute on pop } else { fprintf(stderr,"Could not register service %s.%s on port %u (error %d)/n", master_->name_.c_str(), master_->service_type_.c_str(), master_->port_, error);//, strerror(errno)); } DNSServiceRefDeallocate(service); }
开发者ID:aspeteRakete,项目名称:oscit,代码行数:30,
示例12: publish_main_servicestatic int publish_main_service(struct userdata *u) { DNSServiceErrorType err; TXTRecordRef txt; pa_assert(u); if (u->main_service) { DNSServiceRefDeallocate(u->main_service); u->main_service = NULL; } TXTRecordCreate(&txt, 0, NULL); txt_record_server_data(u->core, &txt); err = DNSServiceRegister(&u->main_service, 0, /* flags */ kDNSServiceInterfaceIndexAny, u->service_name, SERVICE_TYPE_SERVER, NULL, /* domain */ NULL, /* host */ compute_port(u), TXTRecordGetLength(&txt), TXTRecordGetBytesPtr(&txt), NULL, NULL); if (err != kDNSServiceErr_NoError) { pa_log("%s(): DNSServiceRegister() returned err %d", __func__, err); return err; } TXTRecordDeallocate(&txt); return 0;}
开发者ID:Elemecca,项目名称:pulseaudio,代码行数:35,
示例13: socket_callback/* * CFRunloop callback that calls DNSServiceProcessResult() when * there's new data on the socket. */static voidsocket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *context){ struct cbinfo *info = context; DNSServiceErrorType err; if (callbackType == kCFSocketNoCallBack) { printf("socket_callback: kCFSocketNoCallBack?/n"); return; } if ((err = DNSServiceProcessResult(info->sdref)) != kDNSServiceErr_NoError) { printf("DNSServiceProcessResult() returned an error! %d/n", err); if (err == kDNSServiceErr_BadReference) { printf("bad reference?: %p, %d, %p, %p %p/n", s, (int)callbackType, address, data, context); return; } if ((context == &nfsinfo) || (context == &mountdinfo)) { /* bail if there's a problem with the main browse connection */ exit(1); } /* dump the troublesome service connection */ CFRunLoopRemoveSource(CFRunLoopGetCurrent(), info->rls, kCFRunLoopDefaultMode); CFRelease(info->rls); CFSocketInvalidate(info->sockref); CFRelease(info->sockref); DNSServiceRefDeallocate(info->sdref); free(info); }}
开发者ID:Leon555,项目名称:Mac-src-essentials,代码行数:34,
示例14: dnssd_service_free_clientstatic voiddnssd_service_free_client(DNSServiceRef *client) { if (*client) { DNSServiceRefDeallocate(*client); *client = NULL; }}
开发者ID:brianwells,项目名称:dnssd,代码行数:7,
示例15: PR_CancelJobvoidCBFDNSSDService::Cleanup(){ m_stopped = PR_TRUE; if ( m_job ) { PR_CancelJob( m_job ); m_job = NULL; } if ( m_threadPool != NULL ) { PR_ShutdownThreadPool( m_threadPool ); m_threadPool = NULL; } if ( m_fileDesc != NULL ) { PR_Close( m_fileDesc ); m_fileDesc = NULL; } if ( m_sdRef ) { DNSServiceRefDeallocate( m_sdRef ); m_sdRef = NULL; }}
开发者ID:slmnhq,项目名称:bonjourfoxy,代码行数:28,
示例16: BrowseBack/* Sent back from Bounjour -- arbitrarily use it to set the Ref for Deallocation */static void BrowseBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *context){ struct BrowseStruct *browse_struct; (void) context; LEVEL_DETAIL("ref=%ld flags=%d index=%d, error=%d name=%s type=%s domain=%s", (long int) s, f, i, e, name, type, domain); if (e != kDNSServiceErr_NoError) { return ; } browse_struct = Browse_Struct_Create( name, type, domain ) ; if (f & kDNSServiceFlagsAdd) { // Add DNSServiceRef sr; if (DNSServiceResolve(&sr, 0, 0, name, type, domain, ResolveBack, (void *)browse_struct) == kDNSServiceErr_NoError) { ResolveWait(sr) ; DNSServiceRefDeallocate(sr); } else { Browse_Struct_Destroy(browse_struct) ; } } else { // Remove Browse_Struct_Destroy(browse_struct) ; ZeroDel( name, type, domain ) ; }}
开发者ID:M-o-a-T,项目名称:owfs,代码行数:27,
示例17: sizeofDNSServiceErrorType DNSSD_API DNSServiceQueryRecord ( DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, uint16_t rrtype, uint16_t rrclass, DNSServiceQueryRecordReply callBack, void *context ) { char *msg = NULL, *ptr; size_t len; ipc_msg_hdr *hdr; DNSServiceRef sdr; DNSServiceErrorType err; if (!sdRef) return kDNSServiceErr_BadParam; *sdRef = NULL; if (!name) name = "/0"; // calculate total message length len = sizeof(flags); len += sizeof(uint32_t); //interfaceIndex len += strlen(name) + 1; len += 2 * sizeof(uint16_t); // rrtype, rrclass hdr = create_hdr(query_request, &len, &ptr, 1); if (!hdr) goto error; msg = (void *)hdr; put_flags(flags, &ptr); put_long(interfaceIndex, &ptr); put_string(name, &ptr); put_short(rrtype, &ptr); put_short(rrclass, &ptr); sdr = connect_to_server(); if (!sdr) goto error; err = deliver_request(msg, sdr, 1); if (err) { DNSServiceRefDeallocate(sdr); return err; } sdr->op = query_request; sdr->process_reply = handle_query_response; sdr->app_callback = callBack; sdr->app_context = context; *sdRef = sdr; return err;error: if (msg) free(msg); if (*sdRef) { free(*sdRef); *sdRef = NULL; } return kDNSServiceErr_Unknown; }
开发者ID:KrisChaplin,项目名称:LRT2x4_v1.0.2.06_GPL_source,代码行数:60,
示例18: dnssdDeregisterInstancestatic voiddnssdDeregisterInstance( cupsd_srv_t *srv, /* I - Service */ int from_callback) /* I - Called from callback? */{ if (!srv || !*srv) return;# ifdef HAVE_DNSSD (void)from_callback; DNSServiceRefDeallocate(*srv);# else /* HAVE_AVAHI */ if (!from_callback) avahi_threaded_poll_lock(DNSSDMaster); avahi_entry_group_free(*srv); if (!from_callback) avahi_threaded_poll_unlock(DNSSDMaster);# endif /* HAVE_DNSSD */ *srv = NULL;}
开发者ID:AndychenCL,项目名称:cups,代码行数:25,
示例19: _ptpip_enumeratestatic void_ptpip_enumerate ( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context) { struct mdnsinfo mdnsi; DNSServiceRef sd; if (errorCode != kDNSServiceErr_NoError) { gp_log (GP_LOG_ERROR, "ptpip", "Error on _ptp._tcp query."); return; } gp_log (GP_LOG_DEBUG, "ptpip", "found %s, %s, %s", serviceName, regtype, replyDomain); mdnsi.list = context; mdnsi.name = serviceName; DNSServiceResolve (&sd, 0, interfaceIndex, serviceName, regtype, replyDomain, _ptpip_resolved, &mdnsi ); DNSServiceProcessResult (sd); DNSServiceRefDeallocate (sd);}
开发者ID:CastorGemini,项目名称:libgphoto2,代码行数:29,
示例20: player_sd_unregisterint player_sd_unregister(player_sd_t* sd, const char* name){ player_sd_mdns_t* mdns = (player_sd_mdns_t*)(sd->sdRef); player_sd_mdns_dev_t* dev = NULL; int i; for(i=0;i<mdns->mdnsDevs_len;i++) { if(mdns->mdnsDevs[i].valid && !strcmp(name,mdns->mdnsDevs[i].sdDev.name)) { dev = mdns->mdnsDevs + i; break; } } if(dev) { DNSServiceRefDeallocate(dev->regRef); dev->valid = 0; PLAYER_MSG1(2,"Unregistration of %s successful", name); return(0); } else { PLAYER_ERROR1("Failed to find and unregister device %s", name); return(-1); }}
开发者ID:brunoellll,项目名称:player-git-svn,代码行数:30,
示例21: browseCB_ void browseCB_( DNSServiceFlags flags, uint32_t interfaceIdx, DNSServiceErrorType error, const char* name, const char* type, const char* domain ) { if( error != kDNSServiceErr_NoError) { LBWARN << "Browse callback error: " << error << std::endl; return; } if( !( flags & kDNSServiceFlagsAdd )) return; browsedName_ = name; DNSServiceRef service = 0; const DNSServiceErrorType resolve = DNSServiceResolve( &service, 0, interfaceIdx, name, type, domain, (DNSServiceResolveReply)resolveCBS_, this ); if( resolve != kDNSServiceErr_NoError) LBWARN << "DNSServiceResolve error: " << resolve << std::endl; if( service ) { handleEvents_( service, 500 ); DNSServiceRefDeallocate( service ); } }
开发者ID:marwan-abdellah,项目名称:Lunchbox,代码行数:28,
示例22: lockbool CZeroconfBrowserMDNS::doRemoveServiceType(const CStdString& fcr_service_type){ //search for this browser and remove it from the map DNSServiceRef browser = 0; { CSingleLock lock(m_data_guard); tBrowserMap::iterator it = m_service_browsers.find(fcr_service_type); if(it == m_service_browsers.end()) { return false; } browser = it->second; m_service_browsers.erase(it); } //remove the services of this browser { CSingleLock lock(m_data_guard); tDiscoveredServicesMap::iterator it = m_discovered_services.find(browser); if(it != m_discovered_services.end()) m_discovered_services.erase(it); } if (browser) DNSServiceRefDeallocate(browser); return true;}
开发者ID:Anankin,项目名称:xbmc,代码行数:28,
示例23: bonjour_register_cleanup////////////////////////////////////////////////////// cleanup any leftover registration////////////////////////////////////////////////////static int bonjour_register_cleanup( ClientData clientData) { Tcl_HashTable *registerRegistrations = (Tcl_HashTable *)clientData; Tcl_HashEntry *hashEntry = NULL; Tcl_HashSearch searchToken; active_registration *activeRegister = NULL; // run through the remaining entries in the hash table for(hashEntry = Tcl_FirstHashEntry(registerRegistrations, &searchToken); hashEntry != NULL; hashEntry = Tcl_NextHashEntry(&searchToken)) { activeRegister = (active_registration *)Tcl_GetHashValue(hashEntry); // deallocate the service reference DNSServiceRefDeallocate(activeRegister->sdRef); // clean up the memory used by activeRegister ckfree(activeRegister->regtype); ckfree((void *)activeRegister); // deallocate the hash entry Tcl_DeleteHashEntry(hashEntry); } Tcl_DeleteHashTable(registerRegistrations); return(TCL_OK);}
开发者ID:dongola7,项目名称:tcl_bonjour,代码行数:35,
示例24: lockvoid CZeroconfWIN::doStop(){ CSingleLock lock(m_data_guard); for(tServiceMap::iterator it = m_services.begin(); it != m_services.end(); ++it) DNSServiceRefDeallocate(it->second); m_services.clear();}
开发者ID:SirTomselon,项目名称:xbmc,代码行数:7,
示例25: DNSServiceRefDeallocatevoid Manager::deregisterService(){ if( m_publishRef ) { DNSServiceRefDeallocate( m_publishRef ); m_publishRef = 0; }}
开发者ID:vanklompf,项目名称:gloox,代码行数:8,
示例26: WSAAsyncSelect//===========================================================================================================================// Stop//===========================================================================================================================void ExplorerBarWindow::Stop( DNSServiceRef ref ){ m_serviceRefs.remove( ref ); WSAAsyncSelect(DNSServiceRefSockFD( ref ), m_hWnd, WM_PRIVATE_SERVICE_EVENT, 0); DNSServiceRefDeallocate( ref );}
开发者ID:withwave,项目名称:RT5350,代码行数:11,
示例27: DNSServiceRefDeallocate/* * DnsServiceRegistrar::remove * * Un-registers a DNS service and removes it from the list. * * Parameters: * - ref: reference of the service returned by DnsServiceRegistrar::add * * Return value: none */void DnsServiceRegistrar::remove(DNSServiceRef ref){ if(m_serviceList.contains(ref)) { DNSServiceRefDeallocate(ref); m_serviceList.removeAll(ref); Model::logger().addEntry(Logger::Info, "DNS Service un-registered"); }}
开发者ID:picardb,项目名称:QtRemote,代码行数:18,
示例28: DNSServiceRefDeallocatevoid QxtServiceBrowser::stopBrowsing(){ if(qxt_d().notifier) { DNSServiceRefDeallocate(qxt_d().service); qxt_d().notifier->deleteLater(); } qxt_d().notifier = 0;}
开发者ID:01iv3r,项目名称:OpenPilot,代码行数:8,
示例29: mainint main() { OSStatus err; void *tempmem; DNSServiceRef sdRef; DNSServiceErrorType dse; SIOUXSettings.asktosaveonclose = false; SIOUXSettings.userwindowtitle = "/pMulticast DNS Searcher"; SIOUXSettings.rows = 40; SIOUXSettings.columns = 160; printf("DNS-SD Search Client/n/n"); printf("This software reports errors using MacsBug breaks,/n"); printf("so if you don't have MacsBug installed your Mac may crash./n/n"); printf("******************************************************************************/n/n"); if (DNSServiceBrowse == (void*)kUnresolvedCFragSymbolAddress) { printf("Before you can use mDNS/DNS-SD clients, you need to place the /n"); printf("/"Multicast DNS & DNS-SD/" Extension in the Extensions Folder and restart/n"); return(-1); } err = InitOpenTransport(); if (err) { printf("InitOpenTransport failed %d", err); return(err); } // Make sure OT has a large enough memory pool for us to draw from at OTNotifier (interrupt) time tempmem = OTAllocMem(0x10000); if (tempmem) OTFreeMem(tempmem); else printf("**** Warning: OTAllocMem couldn't pre-allocate 64K for us./n"); services.serviceinfolist.fHead = NULL; services.headerPrinted = false; services.lostRecords = false; printf("Sending mDNS service lookup queries and waiting for responses.../n/n"); dse = DNSServiceBrowse(&sdRef, 0, 0, "_http._tcp", "", FoundInstance, &services); if (dse == kDNSServiceErr_NoError) { while (!YieldSomeTime(35)) { if (services.serviceinfolist.fHead) PrintServiceInfo(&services); if (services.lostRecords) { services.lostRecords = false; printf("**** Warning: Out of memory: Records have been missed./n"); } } } DNSServiceRefDeallocate(sdRef); CloseOpenTransport(); return(0); }
开发者ID:withwave,项目名称:RT5350,代码行数:57,
注:本文中的DNSServiceRefDeallocate函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DNSServiceRefSockFD函数代码示例 C++ DNSServiceProcessResult函数代码示例 |