Commit 01aa4ea8 authored by 神楽坂玲奈's avatar 神楽坂玲奈

test

parent f81b267d
......@@ -46,7 +46,7 @@ export class Router {
while (true) {
const quality = next.peers[current.id];
if (!quality || quality.reliability <= 0) return Quality.unreachable; // 不通
result.concat(quality.delay, quality.jitter, quality.reliability, current.outbound_cost + current.inbound_cost);
result.concat(quality.delay, quality.jitter, quality.reliability, current.outbound_cost + next.inbound_cost);
if (next === to) return result; // 到达
// 寻找下一跳
......
......@@ -61,7 +61,6 @@ const socket = dgram
if (from.via.get(to) !== best_route) {
console.log(`change: from ${from.id} to ${to.id} current ${from.via.get(to)!.id} metric ${from.route_quality(to, from.via.get(to)!).metric()} best ${best_route.id} metric ${from.route_quality(to, best_route).metric()}`);
from.via.set(to, best_route);
updating = setInterval(() => send_route(from, to, best_route), config.interval);
send_route(from, to, best_route);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment