|  Developer
Updated on November 14, 2021

setoption()

  • Sets options for the UDP socket. Options are only needed by low-level or time-critical applications. You should only modify an option if you are sure you need it.
  • Option is a string with the option name, and value depends on the option being set
Edit
Parameter Type Required Description
handle int + Connection handle
option string + Option name
value depends Option value

Supported options

Option Value type Default value Description
bool True Requests permission to send broadcast datagrams on the socket
Edit
Nothing
Edit
				
					local network = require("network")
local handle = network.udp();
network.setoption(handle, "broadcast")