![]() |
Connect() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: SocketPool.h |
BOOL Connect( const std::string& rAddress, unsigned short usPort, CSocketPoolSocket* pSocket);
Another type of connect
try { //Protect the socket std::auto_ptr<CSocketPoolSocket> pProtection(pSocket); //Are we closing if (m_bClosing) return TRUE; //Set the connection data pSocket->SetConnectionData(rAddress, usPort); //Lock the CSection CCriticalAutoRelease aRelease(m_pCSection); //Do we have enough space if (m_iActiveSockets>=m_iMaxSocket) { //Can we add to queue if (m_aQueue.size()>m_iMaxBackQueue) return FALSE; //Add the data to the queue m_aQueue.push_back(pSocket); //Release the protection pProtection.release(); //Exit return TRUE; } //Get the socket ++m_iActiveSockets; //Exit the CS aRelease.Exit(); //Try to connect if (!pSocket->Connect()) { //Check the reconnect CheckQueue(); //Exit return FALSE; } else { //Release the protection pProtection.release(); //Exit return TRUE; } } ERROR_HANDLER_RETURN("Connect",FALSE)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |