BroadcastServer:
Filter:
JITLibExtensions/Classes (extension) | Server > Abstractions

BroadcastServer
ExtensionExtension

dispatches osc messages to multiple servers

Description

dispatches osc messages to multiple servers. Where broadcasting does not make sense, it forwards the message call to the local server defined in BroadcastServer.new.

NOTE: BroadCastServer implements the Server interface and thus behaves like one wihtout explicitely being its subclass (duck-typing). All methods specific for BroadCastServer are documented in here, whereas the rest can be looked up in the Server helpfile.

Class Methods

.new

create a new instance. Initialising options are used only for the local server's properties. The other servers are represented by addresses added by addAddr.

NOTE: In multiclient situations, clientID needs to be different for each participant.

Arguments:

name

local server name

addr

local server NetAddr

options

local server ServerOptions

clientID

local server clientID

.for

like *new, but pass in already existing servers directly.

Arguments:

homeServer

the local server

addresses

NetAddres of remote servers.

Instance Methods

.addresses

Addresses the server is supposed to broadcast to. This usually includes the home address.

.homeServer

the home server which is the server used for ID allocation and where normal functions of an individual server (like boot etc.) are relocated to.

.at

Arguments:

index

Returns:

nth NetAddr.

.wrapAt

Arguments:

index

Returns:

nth NetAddr, if index too large, starts from beginning.

.do

Arguments:

function

iterate over all addresses

.addAddr

add a server's address

Arguments:

ip
port

.removeByIP

remove a server's address

Arguments:

ip

an IP address, e.g. "192.168.23.10"

.boot

boots the local server

Examples