UDP socket sending response, lacking sendto

Hi, I’m trying to establish UDP communication in Julia.
For python I see there is a sendto method that lets me respond to the UDP socket https://wiki.python.org/moin/UdpCommunication it’s also in the linux https://linux.die.net/man/2/sendto
but I can’t find it anywhere in https://docs.julialang.org/en/v1/stdlib/Sockets/ nor https://github.com/JuliaLang/julia/blob/v1.5.0/stdlib/Sockets/src/Sockets.jl and also all examples I found out are either one-side communication or for TCP.

I think it is just called send. A UDP Echo server:

using Sockets
s = Sockets.UDPSocket()
# Listen on all local IP addresses for UDP messages sent to port 12222
Socket.bind(s, ip"0.0.0.0", 12222)
while true
    hostport, packet = Sockets.recvfrom(s)
    Sockets.send(s, hostport.host, hostport.port, packet)
end
1 Like

Oh, the send works, thanks!