static void* resolveLoop(void* ptr) { AddressResolution *a = (AddressResolution*)ptr; Redis *r = ntop->getRedis(); while(!ntop->getGlobals()->isShutdown()) { char numeric_ip[64]; int rc = r->popHostToResolve(numeric_ip, sizeof(numeric_ip)); if(rc == 0) { a->resolveHostName(numeric_ip); } else sleep(1); } return(NULL); }
void ReceiverImpl::init(qpid::client::AsyncSession s, AddressResolution& resolver) { sys::Mutex::ScopedLock l(lock); session = s; if (state == CANCELLED) return; if (state == UNRESOLVED) { source = resolver.resolveSource(session, address); assert(source.get()); state = STARTED; } source->subscribe(session, destination); startFlow(l); }
void SenderImpl::init(qpid::client::AsyncSession s, AddressResolution& resolver) { session = s; if (state == UNRESOLVED) { sink = resolver.resolveSink(session, address); state = ACTIVE; } if (state == CANCELLED) { sink->cancel(session, name); parent.senderCancelled(name); } else { sink->declare(session, name); replay(); } }
void SenderImpl::init(qpid::client::AsyncSession s, AddressResolution& resolver) { sys::Mutex::ScopedLock l(lock); session = s; if (state == UNRESOLVED) { sink = resolver.resolveSink(session, address); state = ACTIVE; } if (state == CANCELLED) { sink->cancel(session, name); sys::Mutex::ScopedUnlock u(lock); parent->senderCancelled(name); } else { sink->declare(session, name); replay(l); } }