mirror of
https://git.robbyzambito.me/zaprus
synced 2025-12-20 16:24:50 +00:00
Add CLI to specify dest for relay messages
The dest can be specified as a 4 char ASCII string, or as an IPv4 address.
This commit is contained in:
@@ -39,10 +39,10 @@ fn broadcastSaprusMessage(msg: SaprusMessage, udp_port: u16, allocator: Allocato
|
||||
_ = try sock.sendTo(dest_addr, msg_bytes);
|
||||
}
|
||||
|
||||
pub fn sendRelay(payload: []const u8, allocator: Allocator) !void {
|
||||
pub fn sendRelay(payload: []const u8, dest: [4]u8, allocator: Allocator) !void {
|
||||
const msg = SaprusMessage{
|
||||
.relay = .{
|
||||
.header = .{ .dest = .{ 70, 70, 70, 70 } },
|
||||
.header = .{ .dest = dest },
|
||||
.payload = payload,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user