start(Port, Module, Opts) -> %% Check if the module is an ejabberd listener or an independent listener ModuleRaw = strip_frontend(Module), case ModuleRaw:socket_type() of independent -> ModuleRaw:start_listener(Port, Opts); _ -> start_dependent(Port, Module, Opts) end.
LDstDomain = To#jid.lserver, case mnesia:dirty_read(route, LDstDomain) of [] -> ejabberd_s2s:route(From, To, Packet); [R] -> Pid = R#route.pid, if node(Pid) == node() -> case R#route.local_hint of {apply, Module, Function} -> Module:Function(From, To, Packet); _ -> Pid ! {route, From, To, Packet} end; is_pid(Pid) -> Pid ! {route, From, To, Packet}; true -> drop end; ... end
if(::arg().mustDo("guardian") && !isGuarded(argv)) { if(::arg().mustDo("daemon")) { L.toConsole(Logger::Critical); daemonize(); } guardian(argc, argv); // never get here, guardian will reinvoke process cerr<<"Um, we did get here!"<<endl; }
// we really need to do work - either standalone or as an instance ...
for(;;) { if(!(P=NS->receive(&question))) { // receive a packet inline continue; // packet was broken, try again }
if(P->couldBeCached() && PC.get(P, &cached)) { // short circuit - does the PacketCache recognize this question? NS->send(&cached); // answer it then continue; }
bool UeberBackend::handle::get(DNSResourceRecord &r) { DLOG(L << "Ueber get() was called for a "<<qtype.getName()<<" record" << endl); bool isMore=false; while(d_hinterBackend && !(isMore=d_hinterBackend->get(r))) { // this backend out of answers if(i<parent->backends.size()) { DLOG(L<<"Backend #"<<i<<" of "<<parent->backends.size() <<" out of answers, taking next"<<endl);