Hi,
I had the following code:
void NetworkClient::connectToHost( const QString& ip, int port )
{
m_socket->connectToHost(ip, port);
}
void NetworkClient::connectToHost( const QString& ip, int port )
{
m_socket->connectToHost(ip, port);
}
To copy to clipboard, switch view to plain text mode
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 )
{
m_socket->connectToHost(localIp, port);
}
void NetworkClient::connectToHost( const QString& ip, int port )
{
QString localIp(ip);
m_socket->connectToHost(localIp, port);
}
To copy to clipboard, switch view to plain text mode
And then it worked!
I think it has something to do with implicit sharing, but I don't understand, why this happens!
Please help :-)
Bookmarks