Skip to content

feat: Real Latency Measurement (TCP) [PR #12]#3

Merged
wallydz merged 1 commit intovpnht-rewritefrom
pr12-real-latency
Feb 21, 2026
Merged

feat: Real Latency Measurement (TCP) [PR #12]#3
wallydz merged 1 commit intovpnht-rewritefrom
pr12-real-latency

Conversation

@wallydz-bot
Copy link

@wallydz-bot wallydz-bot bot commented Feb 21, 2026

PR VPNht#12: Real Latency Measurement

Summary

Replaces placeholder latency logic with real TCP-based latency measurement. Supports single-sample and median-of-N measurement modes.

Changes

Backend (src-tauri/)

  • src/latency.rs: Real latency measurement.
    • measure_tcp_latency(): TCP connect timing to host:port with configurable timeout.
    • measure_latency_median(): Multiple samples with median calculation for accuracy.
    • Structured tracing for all measurements (success and failure).

How It Works

  1. Opens a TCP connection to the server's WireGuard port.
  2. Measures the time from connect() to established connection.
  3. For median mode, takes N samples and returns the middle value.

Files Changed

  • src-tauri/src/latency.rs (new)

@wallydz wallydz merged commit 069bf88 into vpnht-rewrite Feb 21, 2026
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.

1 participant