Purpose: Activates all listening sockets added to the server by AddPort(). This must only be called once. Arguments: None

Return TypeFunction nameArguments
hzEcodehzIpServer::Activate(void)

Declared in file: hzIpServer.h
Defined in file : hzIpServer.cpp

Function Logic:

0:START 1:unknown 2:items 3:Return E_INITDUP 4:unknown 5:pLS 6:unknown 7:items 8:Return E_INITFAIL 9:m_bActive 10:Return E_OK

Function body:

hzEcode hzIpServer::Activate (void)
{
   //  Purpose: Activates all listening sockets added to the server by AddPort(). This must only be called once.
   //  
   //  Arguments: None
   //  
   //  Returns: E_INITDUP If this has already been called
   //     E_INITFAIL If one or more listening sockets fail to activate
   //     E_OK  If the operation was successful.
   _hzfunc("hzIpServer::Activate") ;
   if (m_bActive)
   {
       hzerr(E_INITDUP, "All ports already active") ;
       return E_INITDUP ;
   }
   hzList<hzIpListen*>::Iter   I ;     //  Listening socket iterator
   hzIpListen* pLS ;           //  Listening socket
   for (I = m_LS ; I.Valid() ; I++)
   {
       pLS = I.Element() ;
       //  Activate port
       if (pLS->Activate() != E_OK)
       {
           hzerr(E_INITFAIL, "Could not activate listening port (sock %d)", pLS->GetPort()) ;
           return E_INITFAIL ;
       }
   }
   m_bActive = true ;
   return E_OK ;
}