Hello,
Someone esle gave me the solution on another forum.
My error was to use the QTcpSocket in the constructor of MailChecker while it wasn't initialised :
MailChecker
::MailChecker() : QObject(){
}
MailChecker::MailChecker() : QObject()
{
connect(socket_r, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(afficher_erreur_socket(QAbstractSocket::SocketError)));
}
To copy to clipboard, switch view to plain text mode
The good code is :
MailChecker
::MailChecker() : QObject(){
}
MailChecker::MailChecker() : QObject()
{
socket_r = new QTcpSocket();
connect(socket_r, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(afficher_erreur_socket(QAbstractSocket::SocketError)));
}
To copy to clipboard, switch view to plain text mode
Is was initialising my Socket directly in a function that :
- initialise the socket
- connect to host
- submit a request
- listen the answer
- close the socket
- destroy the socket
Thanks Dudule from developpez.net C++ forums 
PS : Thanks jpn, your answer is usefull for me, because I didn't know that
Bookmarks