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:

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:

  • packet table The packet to send.
  • address string The IP address to send to. (optional)
  • port number The port to send to. (optional)

Fields

precision
Fractional precision for bundle scheduling. 1000 is milliseconds. 1000000 is microseconds etc. Any precision is valid that makes sense for the plugin's scheduling function.
generated by LDoc 1.4.6 Last updated 2021-02-01 17:13:04