P@u1
22nd June 2011, 16:37
Hi,
I had the following code:
void NetworkClient::connectToHost( const QString& ip, int port )
{
m_socket->connectToHost(ip, port);
}
and the connect never worked, although i checked the ip and the port with the debugger.
Then I changed it to the following without changing anything else:
void NetworkClient::connectToHost( const QString& ip, int port )
{
QString localIp(ip);
m_socket->connectToHost(localIp, port);
}
And then it worked!
I think it has something to do with implicit sharing, but I don't understand, why this happens!
Please help :-)
I had the following code:
void NetworkClient::connectToHost( const QString& ip, int port )
{
m_socket->connectToHost(ip, port);
}
and the connect never worked, although i checked the ip and the port with the debugger.
Then I changed it to the following without changing anything else:
void NetworkClient::connectToHost( const QString& ip, int port )
{
QString localIp(ip);
m_socket->connectToHost(localIp, port);
}
And then it worked!
I think it has something to do with implicit sharing, but I don't understand, why this happens!
Please help :-)