Hi Roman, > there has been a lot of complains that protocols don't disconnect > themselves > when somehow connection is lost (or disconnect after long time). > > So after lot of googling I found linux only way how we can fix this. > There is TCP_INFO struct which contains info when last ACK was received > and when last data were sent and from this we can check if server still > gets packets from us.
I don't really understand how the line if ( info.tcpi_last_ack_recv >= info.tcpi_last_data_sent && (info.tcpi_last_ack_recv - info.tcpi_last_data_sent) > mTimeoutThreshold ) works (sockettimoutwatcher.cpp:94). If the last ack received time it greater the the last data sent time, that means that the sent data has been acked, right ? So, why check the time difference btween those 2 and not the time difference between the last sent data time and the current time if the ack has not been received yet ? > This is all the code that needs to be add when we want to watch for > timeouts on some tcp based socket > > new SocketTimeoutWatcher(some_tcp_based_socket, timeout); > > I would like to put in into libkopete and add SocketTimeoutWatcher > to most protocols. I'll also add Q_WS_X11 to SocketTimeoutWatcher > so it doesn't break Win or Mac Detlev.
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ kopete-devel mailing list kopete-devel@kde.org https://mail.kde.org/mailman/listinfo/kopete-devel