Module losc.plugins.udp-libuv
UDP client/server implemented with libuv.
These methods should be called from the main losc API.
Info:
- Copyright: David Granström 2021
- License: MIT
- Author: David Granström
Functions
new (options) | Create a new instance. |
now () | Create a Timetag with the current time. |
schedule (timestamp, handler) | Schedule a OSC method for dispatch. |
open (host, port) | Start UDP server. |
close () | Close UDP server. |
send (packet[, address[, port]]) | Send a OSC packet. |
Fields
precision | Fractional precision for bundle scheduling. |
Functions
- new (options)
-
Create a new instance.
Parameters:
- options table Options.
Usage:
local udp = plugin.new()
local udp = plugin.new { sendAddr = '127.0.0.1', sendPort = 9000, recvAddr = '127.0.0.1', recvPort = 8000, ignore_late = true, -- ignore late bundles }
- now ()
-
Create a Timetag with the current time.
Precision is in milliseconds.
Returns:
-
Timetag object with current time.
- schedule (timestamp, handler)
-
Schedule a OSC method for dispatch.
Parameters:
- timestamp number When to schedule the bundle.
- handler function The OSC handler to call.
- open (host, port)
-
Start UDP server.
This function is blocking.
Parameters:
- host string IP address (e.g. '127.0.0.1').
- port number The port to listen on.
- close ()
- Close UDP server.
- send (packet[, address[, port]])
-
Send a OSC packet.
Parameters: