AREXPORT bool ArServerClient::idlePacketCallback(void)
{
  ArNetPacket *idlePacket;
  unsigned int command;
  std::map<unsigned int, ArServerData *>::iterator it;
  ArServerData *serverData;

  if (mySlowIdleThread == NULL)
    mySlowIdleThread = ArThread::self();
  
  myIdlePacketsMutex.lock();
  while (!myIdlePackets.empty())
  {
    idlePacket = myIdlePackets.front();
    myIdlePackets.pop_front();
    myIdlePacketsMutex.unlock();

    command = idlePacket->getCommand();
    if ((it = myDataMap->find(command)) == myDataMap->end())
    {
      ArLog::log(ArLog::Terse, 
  	      "%sArServerClient got request for command %d which doesn't exist during idle... very odd", 
		 myLogPrefix.c_str(), command);
      delete idlePacket;
      return false;
    }
    serverData = (*it).second;

    ArLog::log(myVerboseLogLevel, "Processing idle command %s", 
	       serverData->getName());
    
    pushSlowIdleCommand(command);
    pushSlowIdleForceTcpFlag(true);

    if (serverData->getFunctor() != NULL)
      serverData->getFunctor()->invoke(this, idlePacket);
    if (serverData->getRequestOnceFunctor() != NULL)
      serverData->getRequestOnceFunctor()->invoke(this, idlePacket);

    popSlowIdleCommand();
    popSlowIdleForceTcpFlag();

    delete idlePacket;
    myIdlePacketsMutex.lock();
  }
  myIdlePacketsMutex.unlock();  

  myHaveIdlePackets = false;
  return true;
}