1
0
mirror of https://gitea.farpn.net/w1cdn/mwtchahrd.git synced 2025-10-13 12:58:41 -05:00

Pass raw frame text over UDP.

This commit is contained in:
mattbk
2025-09-28 21:47:26 -05:00
parent 3aa395dc4e
commit 8065fcc24e

View File

@ -400,8 +400,9 @@ fn handle_frame(frame: &AgwFrame, cli: &Cli, buffers: &mut BufferManager) {
// Send UDP
let uaddr = format!("{}:{}", cli.uip, cli.uport);
let socket = UdpSocket::bind("0.0.0.0:0");
let message = "Packet received";
socket.expect("REASON").send_to(message.as_bytes(), uaddr);
//let message = "Packet received";
let message = &text;
let _ = socket.expect("REASON").send_to(message.as_bytes(), uaddr);
// In non-debug mode, print the session line and any additional lines.
if !cli.debug {
@ -422,9 +423,9 @@ fn handle_frame(frame: &AgwFrame, cli: &Cli, buffers: &mut BufferManager) {
fn main() -> Result<()> {
let cli = Cli::parse();
let addr = format!("{}:{}", cli.ip, cli.port);
//let uaddr = format!("{}:{}", cli.uip, cli.uport);
let uaddr = format!("{}:{}", cli.uip, cli.uport);
let reconnect_delay_ms = 5000;
/*
if cli.udp {
// Bind the client socket to any available address and port
let socket = UdpSocket::bind("0.0.0.0:0")?;
@ -432,9 +433,7 @@ fn main() -> Result<()> {
// Send a message to the server
let message = "UDP client connected";
socket.send_to(message.as_bytes(), uaddr)?;
//println!("Sent message to {}: {}", uaddr, message);
}
*/
loop {
println!("Connecting to AGWPE server at {addr}");