# UDP socket sending response, lacking sendto

**URL:** https://discourse.julialang.org/t/udp-socket-sending-response-lacking-sendto/44591
**Category:** General Usage
**Tags:** question, networking
**Created:** [August 8, 2020, 10:54pm UTC](https://discourse.julialang.org/t/udp-socket-sending-response-lacking-sendto/44591 "2020-08-08T22:54:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![racinmat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/racinmat/32/11715_2.png) [@racinmat](https://discourse.julialang.org/u/racinmat)
#### Post date: [August 8, 2020, 10:54pm UTC](https://discourse.julialang.org/t/udp-socket-sending-response-lacking-sendto/44591/1 "2020-08-08T22:54:39Z")

</div>

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](https://wiki.python.org/moin/UdpCommunication) it’s also in the linux [sendto(2): send message on socket - Linux man page](https://linux.die.net/man/2/sendto)  
but I can’t find it anywhere in [Sockets · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Sockets/) nor [https://github.com/JuliaLang/julia/blob/v1.5.0/stdlib/Sockets/src/Sockets.jl](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.

---

<div class="post-metadata">

### Author: ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)
#### Post date: [August 9, 2020, 3:05am UTC](https://discourse.julialang.org/t/udp-socket-sending-response-lacking-sendto/44591/2 "2020-08-09T03:05:01Z")

</div>

I think it is just called [`send`](https://docs.julialang.org/en/v1/stdlib/Sockets/#Sockets.send). A UDP Echo server:

```julia
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

```

---

<div class="post-metadata">

### Author: ![racinmat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/racinmat/32/11715_2.png) [@racinmat](https://discourse.julialang.org/u/racinmat)
#### Post date: [August 9, 2020, 8:19am UTC](https://discourse.julialang.org/t/udp-socket-sending-response-lacking-sendto/44591/3 "2020-08-09T08:19:58Z")

</div>

Oh, the send works, thanks!
