socklen_t len = sizeof(dest);
/* set up destination address */
- memset(&dest,0,sizeof(dest));
- dest.sin_family=AF_INET;
- dest.sin_addr.s_addr=inet_addr(MULTICAST_GROUP);
- dest.sin_port=htons(MULTICAST_PORT);
+ memset(&dest, 0, sizeof(dest));
+ dest.sin_family = AF_INET;
+ dest.sin_addr.s_addr = inet_addr(MULTICAST_GROUP);
+ dest.sin_port = htons(MULTICAST_PORT);
string discovery = "{\"type\":\"discover\"}";
}
Channel::get_ip_port_from_uri(url, &ip, &port);
- map<string,ttl_info>::iterator itr = aliveMap.find(ip);
+ map<string, ttl_info>::iterator itr = aliveMap.find(ip);
if (state == TYPE_DISCOVER) {
return;
if (aliveMap.find(id) == aliveMap.end()) {
} else {
- long _ttl=time(0) + ttl;
+ long _ttl = time(0) + ttl;
ttl_info info = aliveMap[id];
info.update_ttl(_ttl, service_type);
- aliveMap[id]=info;
+ aliveMap[id] = info;
}
}
void SearchProvider::reapServices()
{
- map<string,ttl_info>::iterator it;
- it=aliveMap.begin();
- while(it!=aliveMap.end()) {
- ttl_info info=it->second;
+ map<string, ttl_info>::iterator it;
+ it = aliveMap.begin();
+ while (it != aliveMap.end()) {
+ ttl_info info = it->second;
if ( info.is_expired()) {
- map<string,ttl_info>::iterator toEraseIter = it;
+ map<string, ttl_info>::iterator toEraseIter = it;
++it;
- Service service=getServiceByIp(toEraseIter->first);
+ Service service = getServiceByIp(toEraseIter->first);
MSF_DBG("reapServices - Remove service : [%s]", service.getId().c_str());
aliveMap.erase(toEraseIter->first);
Search::removeServiceAndNotify(service);
}
Service retService = create(serviceval);
- if ( !dev.getmodel().empty() && atoi(dev.getmodel().substr(0,2).c_str()) >= 16 ) {
+ if (!dev.getmodel().empty() && atoi(dev.getmodel().substr(0, 2).c_str()) >= 16) {
MSF_DBG("Secure connection support is true");
retService.SecureConnectionSupport = true;
}
static void dnssd_browse_reply(dnssd_service_state_e service_state, dnssd_service_h remote_service, void *user_data)
{
- MSF_DBG("[MSF : API] Debug log Function : [%s] and line [%d] in file [%s]. State : [%d][%d]",__FUNCTION__ ,__LINE__,__FILE__, service_state, DNSSD_SERVICE_STATE_UNAVAILABLE);
+ MSF_DBG("[MSF : API] Debug log Function : [%s] and line [%d] in file [%s]. State : [%d][%d]", __FUNCTION__, __LINE__, __FILE__, service_state, DNSSD_SERVICE_STATE_UNAVAILABLE);
mDNSSearchProvider* provider = (mDNSSearchProvider*)user_data;
int rv = 0;
MSF_DBG("Handler : %u", remote_service);
void MDNSServiceCallback::onSuccess(Service service)
{
- MSF_DBG("\n [MSF : API] Debug log Function : [%s] and line [%d] in file [%s] \n",__FUNCTION__ ,__LINE__,__FILE__);
+ MSF_DBG("\n [MSF : API] Debug log Function : [%s] and line [%d] in file [%s] \n", __FUNCTION__, __LINE__, __FILE__);
Search::addService(service);
string ip = provider->getIP(service.getUri());
provider->push_in_alivemap(0x00ffffff, ip, MDNS);
void MDNSServiceCallback::onError(Error)
{
- MSF_DBG("\n [MSF : API] Debug log Function : [%s] and line [%d] in file [%s] \n",__FUNCTION__ ,__LINE__,__FILE__);
+ MSF_DBG("\n [MSF : API] Debug log Function : [%s] and line [%d] in file [%s] \n", __FUNCTION__, __LINE__, __FILE__);
}