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 UdpCommunication - Python Wiki it’s also in the linux sendto(2): send message on socket - Linux man page
but I can’t find it anywhere in Sockets · The Julia Language 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!