unreal.OSCServer

class unreal.OSCServer(outer=None, name='None')

Bases: unreal.Object

C++ Source:

  • Plugin: OSC

  • Module: OSC

  • File: OSCServer.h

Editor Properties: (see get_editor_property/set_editor_property)

  • on_osc_bundle_received (OSCReceivedBundleEvent): [Read-Write] Event that gets called when an OSC bundle is received.

  • on_osc_message_received (OSCReceivedMessageEvent): [Read-Write] Event that gets called when an OSC message is received.

add_whitelisted_client(ip_address)None

Adds client to whitelist of clients to listen for.

Parameters

ip_address (str) –

bind_event_to_on_osc_address_pattern_matches_path(osc_address_pattern, event)None

Adds event to dispatch when OSCAddressPattern is matched.

Parameters
clear_whitelisted_clients()None

Clears client whitelist to listen for.

get_bound_osc_address_patterns()

Returns set of OSCAddressPatterns currently listening for matches to dispatch.

Returns

Return type

Array(OSCAddress)

get_ip_address(include_port)str

Returns the IP for the server if connected as a string.

Parameters

include_port (bool) –

Returns

Return type

str

get_multicast_loopback()bool

Gets whether or not to loopback if ReceiveIPAddress provided is multicast.

Returns

Return type

bool

get_port()int32

Returns the port for the server if connected.

Returns

Return type

int32

get_whitelisted_clients()

Returns set of whitelisted clients.

Returns

Return type

Set(str)

is_active()bool

Returns whether server is actively listening to incoming messages.

Returns

Return type

bool

listen()None

Sets the IP address and port to listen for OSC data.

property on_osc_bundle_received

[Read-Write] Event that gets called when an OSC bundle is received.

Type

(OSCReceivedBundleEvent)

property on_osc_message_received

[Read-Write] Event that gets called when an OSC message is received.

Type

(OSCReceivedMessageEvent)

remove_whitelisted_client(ip_address)None

Removes whitelisted client to listen for.

Parameters

ip_address (str) –

set_address(receive_ip_address, port)bool

Set the address and port of server. Fails if server is currently active.

Parameters
  • receive_ip_address (str) –

  • port (int32) –

Returns

Return type

bool

set_multicast_loopback(multicast_loopback)None

Set whether or not to loopback if ReceiveIPAddress provided is multicast.

Parameters

multicast_loopback (bool) –

set_tick_in_editor(tick_in_editor)None

Set whether server instance can be ticked in-editor (editor only and available to blueprint for use in editor utility scripts/script actions).

Parameters

tick_in_editor (bool) –

set_whitelist_clients_enabled(enabled)None

When set to true, server will only process received messages from whitelisted clients.

Parameters

enabled (bool) –

stop()None

Stop and tidy up network socket.

unbind_all_events_from_on_osc_address_pattern_matches_path(osc_address_pattern)None

Removes OSCAddressPattern from sending dispatch events.

Parameters

osc_address_pattern (OSCAddress) –

unbind_all_events_from_on_osc_address_pattern_matching()None

Removes all events from OSCAddressPatterns to dispatch.

unbind_event_from_on_osc_address_pattern_matches_path(osc_address_pattern, event)None

Unbinds specific event from OSCAddress pattern.

Parameters