Open GoogleCodeExporter opened 9 years ago
Bumped against this (apparently old) issue as well and wrote a suggested
"silent reconnect" patch (attached).
I didn't dig deep into code, just wrote a test-case (connection breaker) and
compared the log of broken connection and a cleanly closed one, noticing that
former gets connectionLost event before removing the session, while latter gets
it as a result, and exploited this difference by introducing a "active_close"
flag to session and a simple session re-creation sequence in removeMe method.
Note that it's probably not the best way to do it, and it's only designed to be
a cure for unexpectedly broken (for whatever reason) TCP connections.
Attached are the patch for 838d7a8af86 (git) and the simple scapy-based script
to hijack and break the tcp connection after any activity on it, which can be
used as a simple real-world test-case (unless icq server bans you for too
frequent reconnects) for further improvements.
Original comment by mk.fraggod@gmail.com
on 22 Jan 2011 at 7:05
Attachments:
Original issue reported on code.google.com by
jadest...@gmail.com
on 10 Dec 2007 at 2:55