Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

qt networking server

$
0
0
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 .

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>