I am trying to make a server application .
I looked at the threadedfortuneserver example that comes with QT 5 .
How do you keep a connection open until the client decides to disconnect ? I would like to
maintain a list of all open connections/sockets .
At the end of fortunethread.cpp , the code is :
tcpSocket.write(block);
tcpSocket.disconnectFromHost();
tcpSocket.waitForDisconnected();
So the socket is disconnected . If I comment out the last 2 lines , nothing is written to the client for some reason ?
How do I keep the connection open ? Do I use the socketDescriptor somehow ? I would try that but it seems to me
that the socket connection is gone .
↧