bool_t AsyncAcceptor::Open(unsigned short port, const char *ip) { bool_t ret = FALSE; ret = sock_.Mode(Socket::SOCK_ASYNC_TCP); if(!ret) { ECILA_TRACE(); return FALSE; } ret = sock_.Open(); if(!ret) { ECILA_TRACE(); return FALSE; } ret = PostOpen(); if(!ret) { ECILA_TRACE(); return FALSE; } ret = sock_.Bind(port, ip); if(!ret) { ECILA_TRACE(); return FALSE; } ret = sock_.SetConditionalAccept(TRUE); if(!ret) { ECILA_TRACE(); return FALSE; } ret = sock_.Listen(MAX_BACK_LOG); if(!ret) { ECILA_TRACE(); return FALSE; } ret = PostRead(); if(!ret) { ECILA_TRACE(); return FALSE; } return TRUE; }
FLZOFile::FLZOFile (FILE *file, EOpenMode mode, bool dontCompress) { BeEmpty (); m_Mode = mode; m_File = file; m_NoCompress = dontCompress; PostOpen (); }
bool FLZOFile::Open (const char *name, EOpenMode mode) { Close (); if (name == NULL) return false; m_Mode = mode; m_File = fopen (name, mode == EReading ? "rb" : "wb"); PostOpen (); return !!m_File; }