hello
i am building a c/s application with a server resident on a different computer than those hosting the client.
to begin with, i successfully run both server and client are running on the *same* PC (IP address 192.168.0.8).
then i wanted to make things a bit more difficult, trying to make the communication up and running in my home intranet, i.e. the server is running on a different computer than the client: i.e. server at IP address 192.168.0.13, while the client is running on a different computer at 192.168.0.8 and this does not work: the client cannot listen to the server using IP address and port nr. of the server,
Qt code is as following:
This is for creating connection
connect(tcpKeysFromServer, SIGNAL(newConnection()), this, SLOT(acceptConnectionFromKeysServer()));
tcpKeysFromServer = new QTcpServer(this);
connect(tcpKeysFromServer, SIGNAL(newConnection()), this, SLOT(acceptConnectionFromKeysServer()));
To copy to clipboard, switch view to plain text mode
this is to check client is listening (which is failing)
if (!tcpKeysFromServer
->isListening
() && ! tcpKeysFromServer
-> listen
(QHostAddress (m_ipAddressKeysServer
), m_FromPortKeysServer
) ) {
QString newLabelSvrName
= tr
("Unable to start KEYS server: check IP address!");
ui.labelFromKeysServer->setText(newLabelSvrName);
}
if (!tcpKeysFromServer->isListening() && ! tcpKeysFromServer -> listen (QHostAddress (m_ipAddressKeysServer), m_FromPortKeysServer) )
{
QString newLabelSvrName = tr("Unable to start KEYS server: check IP address!");
ui.labelFromKeysServer->setText(newLabelSvrName);
}
To copy to clipboard, switch view to plain text mode
Bookmarks