![]() |
Initialize() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: DNSSocket.h |
DeclarationBOOL Initialize();
DescriptionInitialize data
Function Body
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)
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |