Skip to content

Conversation

@stefan1000
Copy link

Short description of changes

To avoid correlation on client behaviour this change will randomize the ping intervals, adaptive to the ping time, nearer servers get pinged more often, distant ones less.

To avoid correlation of "hide connect dialog" (ping immediately stops) and "connected to a server" (user appears on a server) it will keep pinging for approx. 60 seconds after the dialog gets hidden.

In addition:

  • introduced enum for UserRole data on LVC_NAME.
  • cache host and port on first use, no need to resolve it every time (in UserRole data)

CHANGELOG: Randomized and adaptive ping intervals in connection dialog, keep ping running after some time after dialog gets closed.

Context: Fixes an issue?

See https://github.com/orgs/jamulussoftware/discussions/3545

Does this change need documentation? What needs to be documented and how?

No.

Status of this Pull Request

What is missing until this pull request can be merged?

Unsure if the diagnostic code (currently only in debug builds) can/should be kept in.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

stefan1000 and others added 16 commits October 18, 2025 17:09
- make sure that after the dialog is hidden all server get a ping soon, also distant ones, but still in a way that it is not regular pattern
- use randomized timer interval of 1000-1250ms since the real interval is calculated internally by skipping, also changed this to be smooth scaled
- cleanup the map stuff, just store this in the Qt::UserRole data
- network address is costly, cache it in Qt::UserRole
- renamed things a bit and cleanup
…e normal 2500ms ping interval otherwise the longer delay will be treated as a stop of ping, fPingMaxMultiplier is now 3.0 instead of 9.0, could be increased in the future...
- store all data in UserRole of first column, no need to have an invisible column,
- added enum for userrole fields
- detailed stats only in debug
- some minor adjustments on timings
qDebug() << "\nPattern analysis:";
qDebug() << " Average pings/sec:" << QString::number ( avgPingsPerSecond, 'f', 2 );
qDebug() << " Spikes detected (>2x avg):" << iSpikesDetected << "seconds";
qDebug() << " Distribution: " << ( iSpikesDetected > 10 ? "IRREGULAR (many spikes)" : "SMOOTH (good stealth)" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set up a time-out when a burst of pings arrive from one IP:PORT, because I thought these were non-clients. Then my own client triggered the time-out for bursting pings. Seems odd for the client to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants