In fact, When only one try of connection is done, all seems to be Ok :
Code: Select all
//creation du "socket"
if(!m_pConnectionClient)
{
m_pConnectionClient=Socket::createConnectionClient();
//connection à un serveur
m_pConnectionClient->connect(l_sServerName, l_ui32ServerPort);
if(!m_pConnectionClient->isConnected())
{
this->getLogManager() << LogLevel_ImportantWarning << "Could not connect to server " << l_sServerName << ":" << l_ui32ServerPort << "\n";
return false;
}
}
Code: Select all
//creation du "socket"
if(!m_pConnectionClient)
{m_pConnectionClient=Socket::createConnectionClient();}
//connection à un serveur
if(m_pConnectionClient && !m_pConnectionClient->isConnected())
{
m_pConnectionClient->connect(l_sServerName, l_ui32ServerPort);
if(!m_pConnectionClient->isConnected())
{
this->getLogManager() << LogLevel_ImportantWarning << "Could not connect to server " << l_sServerName << ":" << l_ui32ServerPort << "\n";
return true;
}
}