empty reply of a POST request
I have a piece of code that makes a POST request to a server and gets the reply. If I put this code into a class instantiated in my main application it works fine.
Code:
int main(int argc, char *argv[])
{
MyClass*camera = new MyClass();
//In MyClass constructor is made the POST request and displayed the result
return app.exec();
};
If I put it into a shared library and use this library in my application, I receive always an empty reply. I know is not really very specific, but since the code works from the main application, I do not think is a problem with the code.
In my library I have a class like this:
Code:
class LINUXSDKSHARED_EXPORT LinuxSDK
: public QObject{
Q_OBJECT
...
public:
~LinuxSDK();
...
public slots:
void onfinish(QNetworkReply *rep);
The SLOT is working, it is called. I tried with a QEventLoop to wait for a reply but it looks like waits forever. I work in Ubuntu. The status code of the reply is 0, meaning the connection was accepted and then closed gracefully (TCP FIN). Why was it closed?
Can you help me with some useful ideas?
Thanks
Re: empty reply of a POST request
And your main() is the same? Just the class defined in a library?
Cheers,
_
Re: empty reply of a POST request
I think I solved it. I have derived MyClass from QMainWindow instead of QObject. It seams it works now