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.
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();
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyClass*camera = new MyClass();
//In MyClass constructor is made the POST request and displayed the result
return app.exec();
};
To copy to clipboard, switch view to plain text mode
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:
class LINUXSDKSHARED_EXPORT LinuxSDK
: public QObject{
Q_OBJECT
...
public:
~LinuxSDK();
...
public slots:
void onfinish(QNetworkReply *rep);
class LINUXSDKSHARED_EXPORT LinuxSDK: public QObject
{
Q_OBJECT
...
public:
LinuxSDK(QObject *parent = 0);
~LinuxSDK();
...
public slots:
void onfinish(QNetworkReply *rep);
To copy to clipboard, switch view to plain text mode
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
Bookmarks