diff options
author | Robby Zambito <contact@robbyzambito.me> | 2025-04-27 16:11:12 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2025-04-27 18:03:06 -0400 |
commit | cc8438448d3e093d0aabf52d97e11a6514a82765 (patch) | |
tree | 0de8d424c12005e0b3842140af55fc002cf6c1f6 /src/Client.zig | |
parent | 683a2015b0a2d410d012bef404e891da5f6f261e (diff) |
Staring real connections
Diffstat (limited to 'src/Client.zig')
-rw-r--r-- | src/Client.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Client.zig b/src/Client.zig index 19f8360..c518c74 100644 --- a/src/Client.zig +++ b/src/Client.zig @@ -76,7 +76,7 @@ pub fn sendInitialConnection(payload: []const u8, initial_port: u16, allocator: return msg; } -pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusMessage { +pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusConnection { var initial_port: u16 = 0; if (rand) |r| { initial_port = r.intRangeAtMost(u16, 1024, 65000); @@ -109,10 +109,14 @@ pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusMessage { // Complete handshake after awaiting response try broadcastSaprusMessage(msg, randomPort(), allocator); - return initial_conn_res; + if (false) { + return initial_conn_res.?; + } + return null; } const SaprusMessage = @import("message.zig").Message; +const SaprusConnection = @import("Connection.zig"); const std = @import("std"); const Random = std.Random; |