Re: class and event create
3. connect error signal from socket to an appropriate slot in your code.
Re: class and event create
Thanks for recommend but I don't catch. I connected to SocketErrors signal and my slot is displayError.
Code:
TcpClient
::TcpClient(const QString serverAddress,
int serverPort
){
_serverAddress = serverAddress;
_serverPort = serverPort;
}
{
switch (socketError) {
break;
msg = tr("The host was not found. Please check the "
"host name and port settings.");
break;
msg = tr("The connection was refused by the peer. "
"Make sure the fortune server is running, "
"and check that the host name and port "
"settings are correct.");
break;
default:
msg = tr("The following error occurred: %1.")
.arg(tcpSocket->errorString());
}
errorbox->setText(msg);
errorbox->show();
}
But This code is my TcpClient clas. i close server socket and i wait error but not catch. Where I made a mistake?