mirror of
https://git.robbyzambito.me/zaprus
synced 2025-12-20 16:24:50 +00:00
Big changes to the C api implementations
Should map directly to the zig struct instead of mallocing
This commit is contained in:
@@ -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) !SaprusMessage {
|
||||
var initial_port: u16 = 0;
|
||||
if (rand) |r| {
|
||||
initial_port = r.intRangeAtMost(u16, 1024, 65000);
|
||||
@@ -109,7 +109,7 @@ pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusMessage {
|
||||
// Complete handshake after awaiting response
|
||||
try broadcastSaprusMessage(msg, randomPort(), allocator);
|
||||
|
||||
return initial_conn_res;
|
||||
return initial_conn_res.?;
|
||||
}
|
||||
|
||||
const SaprusMessage = @import("message.zig").Message;
|
||||
|
||||
Reference in New Issue
Block a user