Unsolved QAbstractSocket strange behavior when connection is closed from server side
-
I have posted a question at Stackoverflow, but nobody answered to my question. My post is too long, so I will not copy it in here.
Here is the link to my post.
Please, let me know what's wrong with my implementation.
-
@leonardooyama said in QAbstractSocket strange behavior when connection is closed from server side:
Please, let me know what's wrong with my implementation.
nothing is wrong with your implementation. This is rather normal behavior (unfortunately).
You would receive a disconnect after quite some time - when the next TCP KeepAlive packet is send.For MS Windows see this for example.
When you for example would send a periodic "KeepAlive" data message or implement a polling mechanism over the socket you would receive the disconnect a few seconds after it really has been disconnected (this OS dependant). How much time later depends on the OS which retries the connection a few times before finally concluding that the connection is really torn down.
So simply try to send data (for example a single control character to keep the footprint low) every 500ms and you will notice what i've described above.
-
@raven-worx Thanks for answering my question!