Skip to content

Commit

Permalink
doc: add basic documentation for UDP functions
Browse files Browse the repository at this point in the history
(ref #5772)
  • Loading branch information
ihnorton committed Dec 15, 2014
1 parent cf8e53d commit 1d8e162
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,23 @@ Network I/O
Monitor a file for changes by polling every `interval_seconds` seconds for `seconds` seconds. A return value of true indicates
the file changed, a return value of false indicates a timeout.

.. function:: bind(socket::Union(UDPSocket, TCPSocket), host::IPv4, port::Integer)

Bind ``socket`` to the given ``host:port``. Note that `0.0.0.0` will listen on all devices.

.. function:: send(socket::UDPSocket, host::IPv4, port::Integer, msg)

Send ``msg`` over ``socket to ``host:port``.

.. function:: recv(socket::UDPSocket)

Read a UDP packet from the specified socket, and return the bytes received. This call blocks.

.. function:: setopt(sock::UDPSocket; multicast_loop = nothing, multicast_ttl=nothing, enable_broadcast=nothing, ttl=nothing)

Set UDP socket options. ``multicast_loop``: loopback for multicast packets (default: true). ``multicast_ttl``: TTL for multicast packets. ``enable_broadcast``: flag must be set to true if socket will be used for broadcast messages, or else the UDP system will return an access error (default: false). ``ttl``: Time-to-live of packets sent on the socket.


Text I/O
--------

Expand Down

4 comments on commit 1d8e162

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have any of these changed at all since 0.3, or is this @JuliaBackports - worthy?

@ihnorton
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference is UdpSocket vs. UDPSocket.

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good call. Looks like also TcpSocket

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backported in 6dc0737

Please sign in to comment.