DatagramPlugin
Extends:
OSC plugin for simple OSC messaging via udp client and udp server
Test:
Constructor Summary
Public Constructor | ||
public |
constructor(options: object) Create an OSC Plugin instance with given options. |
Member Summary
Private Members | ||
private |
|
|
private |
|
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
close() Close udp socket |
|
public |
Bind a udp socket to a hostname and port |
|
public |
send(binary: Uint8Array, customOptions: object) Send an OSC Packet, Bundle or Message. |
|
public |
Returns the current status of the connection |
Private Methods | ||
private |
registerNotify(fn: function) Internal method to hook into osc library's EventHandler notify method |
Inherited Summary
From class Plugin | ||
public |
close() Close socket connection and anything else used in the implementation. |
|
public |
Open socket connection. |
|
public |
send(binary: Uint8Array, customOptions: object) Send an OSC Packet, Bundle or Message. |
|
public |
Returns the current status of the connection |
Public Constructors
public constructor(options: object) source
Create an OSC Plugin instance with given options. Defaults to localhost:41234 for server and localhost:41235 for client messaging
Override:
Plugin#constructorParams:
Name | Type | Attribute | Description |
options | object |
|
Custom options |
options.type | string |
|
'udp4' or 'udp6' |
options.open.host | string |
|
Hostname of udp server to bind to |
options.open.port | number |
|
Port of udp server to bind to |
options.open.exclusive | boolean |
|
Exclusive flag |
options.send.host | string |
|
Hostname of udp client for messaging |
options.send.port | number |
|
Port of udp client for messaging |
Example:
const plugin = new OSC.DatagramPlugin({ send: { port: 9912 } })
const osc = new OSC({ plugin: plugin })
Private Members
Public Methods
public open(customOptions: object) source
Bind a udp socket to a hostname and port
Override:
Plugin#openParams:
Name | Type | Attribute | Description |
customOptions | object |
|
Custom options |
customOptions.host | string |
|
Hostname of udp server to bind to |
customOptions.port | number |
|
Port of udp server to bind to |
customOptions.exclusive | boolean |
|
Exclusive flag |
public send(binary: Uint8Array, customOptions: object) source
Send an OSC Packet, Bundle or Message. Use options here for custom port and hostname, otherwise the global options will be taken
Override:
Plugin#sendParams:
Name | Type | Attribute | Description |
binary | Uint8Array | Binary representation of OSC Packet |
|
customOptions | object |
|
Custom options for udp socket |
customOptions.host | string |
|
Hostname of udp client |
customOptions.port | number |
|
Port of udp client |