Using QNetworkReply multiple times
-
Hey, I need to send out many network requests throughout the lifetime of my application and I am running into difficulties with
QNetworkReplys because I need to do some work once the http response arrives, so I need to connect a slot to the finished signal ofQNetworkReply.
I need to send the same http request multiple times, thus I can not use oneQNetworkReplyand simply connect a slot to its finished signal, since the second, third, ... http request would mess this up when trying to connect them to the finished signals of the sameQNetworkReply.I think that it should be doable to write a container which dynamically creates
QNetworkReplys for you and deletes the existing ones, which are no longer used.Does something like this already exist by any chance, or would I need to implement it myself?
Thanks in advance. -
@Creaperdown said in Using QNetworkReply multiple times:
I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.
I don't understand this - a QNetworkReply returns some data for a request. You can do with this data whatever you want so why do you need to duplicate the reply then?
@Christian-Ehrlicher I am sorry, I have realized that I have used QNetworkReplys wrongly. Someone has mentioned the correct way to connect signals and slots on it and now my problem does not persist anymore
-
Hey, I need to send out many network requests throughout the lifetime of my application and I am running into difficulties with
QNetworkReplys because I need to do some work once the http response arrives, so I need to connect a slot to the finished signal ofQNetworkReply.
I need to send the same http request multiple times, thus I can not use oneQNetworkReplyand simply connect a slot to its finished signal, since the second, third, ... http request would mess this up when trying to connect them to the finished signals of the sameQNetworkReply.I think that it should be doable to write a container which dynamically creates
QNetworkReplys for you and deletes the existing ones, which are no longer used.Does something like this already exist by any chance, or would I need to implement it myself?
Thanks in advance.@Creaperdown said in Using QNetworkReply multiple times:
I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.
I don't understand this - a QNetworkReply returns some data for a request. You can do with this data whatever you want so why do you need to duplicate the reply then?
-
@Creaperdown said in Using QNetworkReply multiple times:
I think that it should be doable to write a container which dynamically creates QNetworkReplys for you and deletes the existing ones, which are no longer used.
I don't understand this - a QNetworkReply returns some data for a request. You can do with this data whatever you want so why do you need to duplicate the reply then?
@Christian-Ehrlicher I am sorry, I have realized that I have used QNetworkReplys wrongly. Someone has mentioned the correct way to connect signals and slots on it and now my problem does not persist anymore
-
C Creaperdown has marked this topic as solved on