Hello, you're using /sockudp to send a packet without the -n switch, which won't add a $crlf at the end of the packet.
In your reading, when you do /sockread %a, this will only read a terminated line (ending with $crlf or $lf), if the line doesn't end with a $crlf or $lf, /sockread %a will read nothing.
You should always make sure data has been read with $sockbr.
You can force a read of whatever is in the received buffer by using the -f switch in /sockread, i'll show the line by line method:
on *:udpread:test:{
if ($sockerr) { echo -s An error occured while trying to read data: $sock($sockname).wsmsg | return }
else {
var %a
sockread %a
;if sockread isn't reading a line, we return
if ($!sockbr) return
echo -s rcvd: %a
}
}
alias start_udp_listener {
var %udpPort = 12345
sockudp -k test 127.0.0.1 %udpPort
echo -s UDP Server is listening on port %udpPort ...
}
/sockudp -tn test 127.0.0.1 12345 hello
Also, you're using the same socket name to create the listening server and a client, not too sure about that, you might want to use a different socket name when trying to send a packet