mirror of
https://git.robbyzambito.me/zaprus
synced 2025-12-20 16:24:50 +00:00
This commit is contained in:
@@ -33,6 +33,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
});
|
});
|
||||||
|
|
||||||
lib_mod.addImport("network", b.dependency("network", .{}).module("network"));
|
lib_mod.addImport("network", b.dependency("network", .{}).module("network"));
|
||||||
|
lib_mod.addImport("gatorcat", b.dependency("gatorcat", .{}).module("gatorcat"));
|
||||||
|
|
||||||
exe_mod.addImport("zaprus", lib_mod);
|
exe_mod.addImport("zaprus", lib_mod);
|
||||||
exe_mod.addImport("clap", b.dependency("clap", .{}).module("clap"));
|
exe_mod.addImport("clap", b.dependency("clap", .{}).module("clap"));
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ pub fn sendInitialConnection(payload: []const u8, initial_port: u16, allocator:
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusConnection {
|
pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusConnection {
|
||||||
|
var foo: gcat.nic.RawSocket = try .init("enp7s0");
|
||||||
|
defer foo.deinit();
|
||||||
|
// _ = gcat.nic.RawSocket;
|
||||||
var initial_port: u16 = 0;
|
var initial_port: u16 = 0;
|
||||||
if (rand) |r| {
|
if (rand) |r| {
|
||||||
initial_port = r.intRangeAtMost(u16, 1024, 65000);
|
initial_port = r.intRangeAtMost(u16, 1024, 65000);
|
||||||
@@ -124,5 +127,6 @@ const posix = std.posix;
|
|||||||
const mem = std.mem;
|
const mem = std.mem;
|
||||||
|
|
||||||
const network = @import("network");
|
const network = @import("network");
|
||||||
|
const gcat = @import("gatorcat");
|
||||||
|
|
||||||
const Allocator = mem.Allocator;
|
const Allocator = mem.Allocator;
|
||||||
|
|||||||
Reference in New Issue
Block a user