jackmack
22nd July 2010, 08:12
Hi all,
some background information:
I have a simple application with running a server. Several other apps should be able to connect as client to it.
Now I'm using QTcpServer. After call listen() the server is able to accept incoming clients.
I have connected the newConnection() signal to a private slot clientConnected(). According as the docs I call within nextPendingConnection() to get an instance of QTcpSocket. Then I connect the signal disconnected() to slot deleteLater() of that instance.
If several clients connects to the server there are several QTcpSocket instances. I store the reference of instances to a list because the server should send data to all connected clients.
Now the problem:
If one client aborts the connection how I can remove the reference of that QTcpSocket instance from my list?
The disconnect() signal is handled within the scope of QTcpSocket. I should have a method like QTcpServer::connectionAborted(QTcpSocket* client).
Have anybody an idea?
Thanks, Jack
some background information:
I have a simple application with running a server. Several other apps should be able to connect as client to it.
Now I'm using QTcpServer. After call listen() the server is able to accept incoming clients.
I have connected the newConnection() signal to a private slot clientConnected(). According as the docs I call within nextPendingConnection() to get an instance of QTcpSocket. Then I connect the signal disconnected() to slot deleteLater() of that instance.
If several clients connects to the server there are several QTcpSocket instances. I store the reference of instances to a list because the server should send data to all connected clients.
Now the problem:
If one client aborts the connection how I can remove the reference of that QTcpSocket instance from my list?
The disconnect() signal is handled within the scope of QTcpSocket. I should have a method like QTcpServer::connectionAborted(QTcpSocket* client).
Have anybody an idea?
Thanks, Jack