Purpose: Creates singleton hzIpServer instance Pointer to the hzIpServer instance. The same instance is returned however many times this function is called. NULL if no logger is provided

Return TypeFunction nameArguments
hzIpServer*hzIpServer::GetInstance(hzLogger*,)

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

Function Logic:

0:START 1:unknown 2:items 3:Return 0 4:unknown 5:pSvr 6:pSvr pSvr s_pTheOneAndOnlyServer 7:Return pSvr

Function body:

hzIpServer* hzIpServer::GetInstance (hzLogger* pLogger)
{
   //  Purpose: Creates singleton hzIpServer instance
   //  
   //  Argument: pLogger The logger for the server (compulsory)
   //  
   //  Returns: Pointer to the hzIpServer instance. The same instance is returned however many times this function is called.
   //     NULL if no logger is provided
   _hzfunc("hzIpServer::GetInstance") ;
   hzIpServer* pSvr = 0;   //  TCP server
   if (!pLogger)
       { hzerr(E_NOINIT, "No logfile supplied") ; return 0; }
   if (s_pTheOneAndOnlyServer)
       pSvr = s_pTheOneAndOnlyServer ;
   else
   {
       pSvr = new hzIpServer() ;
       pSvr->m_pLog = pLogger ;
       s_pTheOneAndOnlyServer = pSvr ;
   }
   return pSvr ;
}