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

BroadcastServer : Object
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

BroadcastServer.new(name, addr, options, clientID)

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

BroadcastServer.for(homeServer, addresses)

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

Arguments:

homeServer

the local server

addresses

NetAddres of remote servers.

Inherited class methods

Instance Methods

.addresses

.addresses = value

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

.homeServer

.homeServer = value

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(index)

Arguments:

index

Returns:

nth NetAddr.

.wrapAt(index)

Arguments:

index

Returns:

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

.do(function)

Arguments:

function

iterate over all addresses

.addAddr(ip, port)

add a server's address

Arguments:

ip
port

.removeByIP(ip)

remove a server's address

Arguments:

ip

an IP address, e.g. "192.168.23.10"

.boot

boots the local server

Inherited instance methods

Undocumented instance methods

.addr = value

Examples