refactor p2p: keepalive pings, WASM-safe messaging, non-blocking

connections
This commit is contained in:
2026-02-19 11:36:11 -03:00
parent 75087fb635
commit 7b120731a6
10 changed files with 288 additions and 142 deletions

View File

@@ -4,6 +4,7 @@
//! These functions handle file addition, sharing, downloading, and transfer message processing.
const std = @import("std");
const platform_time = @import("platform").time;
// Core components (via module import)
const core = @import("core");
@@ -315,7 +316,7 @@ pub fn handleFileTransferMessageImpl(p2p: *P2P, peer_id: [32]u8, data: []const u
.message_id = 0,
.peer_id = &peer_id,
.data = &reject_payload,
.timestamp = std.time.timestamp(),
.timestamp = platform_time.timestamp(),
};
if (fm.network_sender) |sender| {
_ = sender.sendMessage(reject_msg) catch {};