[Development] QTcpSocket disconnect signal surprise

Thiago Macieira thiago.macieira at intel.com
Sun Dec 11 19:36:40 CET 2016


On domingo, 11 de dezembro de 2016 15:16:11 PST Oleg Shalnev wrote:
> Good day, all in the list!
> 
> Some problems during detection "connection lost" via KeepAlive and
> disconnect signal.
> 
> After enabling KeepAlive, if there is some data in the socket buffer,
> disconnect signal is not working. So there is no way to detect cable lost.
> 
> After disconnecting, socket don't send disconnect signal, don't send
> stateChanged signal, don't send error code.
> bytesToWrite() returns 0 bytes.
> 
> If there is no data in the socket disconnected signal is working normal.
[cut]
> Can enybody help me with this problem?

[This is the list for development of Qt, so I am assuming we're trying to 
figure out if this is a bug in Qt]

Can you check with a tool like strace (on Linux) if the socket disconnects? 
What's the difference in OS behaviour between the case when it works and when 
it doesn't?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list