jackmack
23rd July 2010, 10:22
Hi there,
I use the QTcpSocket and QTcpServer classes in my application.
My application has to make sure that the communication always is ok. If some network error occurs like connection abort the I thougt QTcpSocket recognizes that.
But NO! You can simple test it with unplugging the network cable on client side. NO stateChange() or error() is called.
If you unplug the cable on your PC then it's recognized (I think this done by checking hardware directly).
Also if I set the TCP_KEEPALIVE option there is no diffrent. Default setting of KEEPALIVE is 2 hours!!! on windows. I think only enabling KEEPALIVE is poor. You have additional set the timeouts of that function.
I wonder me also why the stateChanged() signal is sent if client aborts but if client connects there is no stateChanged() sent.
A solution is to use a "heartbeat" telegram. But this should done tcp/ip levels and not on users level.
Any experince?
I use the QTcpSocket and QTcpServer classes in my application.
My application has to make sure that the communication always is ok. If some network error occurs like connection abort the I thougt QTcpSocket recognizes that.
But NO! You can simple test it with unplugging the network cable on client side. NO stateChange() or error() is called.
If you unplug the cable on your PC then it's recognized (I think this done by checking hardware directly).
Also if I set the TCP_KEEPALIVE option there is no diffrent. Default setting of KEEPALIVE is 2 hours!!! on windows. I think only enabling KEEPALIVE is poor. You have additional set the timeouts of that function.
I wonder me also why the stateChanged() signal is sent if client aborts but if client connects there is no stateChanged() sent.
A solution is to use a "heartbeat" telegram. But this should done tcp/ip levels and not on users level.
Any experince?