Dr.Lastname
Dr.Lastname

Reputation: 21

UDP connections in Julia

using Sockets
sock = UDPSocket()
bind(sock,ip"x.x.x.x",port)

I am new to Sockets.jl and when I run this code in the REPL, the bind() function returns "false". Does anyone know what this means? I'm sure I have the right IP and port#. There isn't much documentation for the Sockets.jl package.

Upvotes: 1

Views: 206

Answers (1)

Sundar R
Sundar R

Reputation: 14695

Checking the Sockets.jl code, bind returns false only if one of these three errors occurs:

  • UV_EACCES = permission denied
  • UV_EADDRINUSE = address already in use
  • UV_EADDRNOTAVAIL = address not available

Do you have a firewall that might be blocking UDP access? If you're sure about the IP address being correct, then UV_EACCES seems like the most likely reason for failure here.

Upvotes: 1

Related Questions