Best way to retrieve data from different servers using UDPSocket
-
Good morning,
I'm working on a program used to display informations of many game servers (average 150).
I thought create a class "ServerQuery" that contains contains my UDPSocket (under unique_ptr) and the functions to send and retrieve the information from one server.
The problem is that I'm using a slots and connect, so I can't create an instance of ServerQuery class in local function.
I thought that I can create a QList of ServerQuery attribute and for each sent I push an instance in this QList and remove it at the end of communication.
(I just need to send and retrieve the information, after that, the socket can be closed).
Thanks you in advance,
Alexandre -
I am not sure where you see the problems.
The connections between signal and slots are removed with destruction of either object
There is an issue when you are deleting an object when you are deleting it from the slot routine which is called an object's signal. I can imagine that there you may face a problem when using unique_ptr. To avoid this there is deleteLater()