![]() |
Initialize() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: DNSSocket.h |
BOOL Initialize();
Initialize data
try { //Initialize our sockets //if TCP if (m_bUseTCP) { //Do we have the socket if (m_pTCP) delete m_pTCP; //Create the socket m_pTCP=new CDNSTCPSocket(this); //Try to create it if (!m_pTCP->Create()) { //Write the error ReportError("Initialize","Failed to create socket!"); //Exit return FALSE; } //Set the blocking mode if (!m_bAsync) if (!m_pTCP->ReBlock()) { //Write an error ReportError("Initialize","Failed to switch socket to blocking mode!"); //And exit return FALSE; } else ; else //Set it to have buffer m_pTCP->AllowBlockedBuffer(TRUE); } else { //Do we have it if (m_pUDP) delete m_pUDP; //Create the socket m_pUDP=new CDNSUDPSocket(this); //Try to create it if (!m_pUDP->Create()) { //Write the error ReportError("Initialize","Failed to create socket!"); //Exit return FALSE; } //Set the blocking mode if (!m_bAsync) if (!m_pUDP->ReBlock()) { //Write an error ReportError("Initialize","Failed to switch socket to blocking mode!"); //And exit return FALSE; } else ; else if (!m_pUDP->Listen()) { //Write an error ReportError("Initialize","Failed to listen on socket to blocking mode!"); //And exit return FALSE; } } //Done return TRUE; } ERROR_HANDLER_RETURN("Initialize",FALSE)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |