Return TypeFunction nameArguments
hzEcodehzLogger::Close(void)

Declared in file: hzProcess.h
Defined in file : hzLogger.cpp

Function Logic:

0:START 1:m_File 2:m_pFile 3:fclose 4:m_pFile m_nSessID hzString::Clear hzString::Clear 5:Return E_OK 6:u getpid nProcID u u u u u u u u u u nBytes 7:m_pConnection->Send(m_cvData,nBytes)!=E_OK 8:Return E_SENDFAIL 9:m_pConnection->Recv(m_cvData,nBytes,64)!=E_OK 10:Return E_RECVFAIL 11:m_cvData[0]==LS_OK 12:Return E_OK 13:Return E_PROTOCOL

Function body:

hzEcode hzLogger::Close (void)
{
   _hzfunc("hzLogger::Close") ;
   uint32_t    nBytes ;
   uint32_t    nProcID ;
   uchar*      u ;
   if (m_File)
   {
       if (m_pFile)
           fclose(m_pFile) ;
       m_pFile = 0;
       m_nSessID = 0;
       m_Base.Clear() ;
       m_File.Clear() ;
       return E_OK ;
   }
   u = (uchar*) m_cvData ;
   nProcID = getpid() ;
   u[0]= LS_STOP ;
   u[1]= 0;
   u[2]= 8;
   u[3]= (m_nSessID & 0x00ff0000)>>16;
   u[4]= (m_nSessID & 0x0000ff00)>>8;
   u[5]= (m_nSessID & 0x000000ff);
   u[6]= (nProcID & 0xff00)>>8;
   u[7]= (nProcID & 0xff00)>>8;
   u[8]= (nProcID & 0xff00)>>8;
   u[9]= (nProcID & 0xff);
   nBytes = 10;
   if (m_pConnection->Send(m_cvData, nBytes) != E_OK)
       return E_SENDFAIL ;
   if (m_pConnection->Recv(m_cvData, nBytes, 64)!=E_OK)
       return E_RECVFAIL ;
   if (m_cvData[0]== LS_OK)
       return E_OK ;
   return E_PROTOCOL ;
}