unreal.OSCServer

class unreal.OSCServer(outer: Object | None = None, name: Name | str = 'None')

Bases: 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_allowlisted_client(ip_address) None

Adds client to allowlist of clients to listen for.

Parameters:

ip_address (str) –

add_whitelisted_client(ip_address: str) None

deprecated: ‘add_whitelisted_client’ was renamed to ‘add_allowlisted_client’.

bind_event_to_on_osc_address_pattern_matches_path(osc_address_pattern, event) None

Adds event to dispatch when OSCAddressPattern is matched.

Parameters:
clear_allowlisted_clients() None

Clears client allowlist to listen for.

clear_whitelisted_clients() None

deprecated: ‘clear_whitelisted_clients’ was renamed to ‘clear_allowlisted_clients’.

get_allowlisted_clients() Set[str]

Returns set of allowlisted clients.

Return type:

Set[str]

get_bound_osc_address_patterns() Array[OSCAddress]

Returns set of OSCAddressPatterns currently listening for matches to dispatch.

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) –

Return type:

str

get_multicast_loopback() bool

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

Return type:

bool

get_port() int32

Returns the port for the server if connected.

Return type:

int32

get_whitelisted_clients() None

deprecated: ‘get_whitelisted_clients’ was renamed to ‘get_allowlisted_clients’.

is_active() bool

Returns whether server is actively listening to incoming messages.

Return type:

bool

listen() None

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

property on_osc_bundle_received: OSCReceivedBundleEvent

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

Type:

(OSCReceivedBundleEvent)

property on_osc_message_received: OSCReceivedMessageEvent

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

Type:

(OSCReceivedMessageEvent)

remove_allowlisted_client(ip_address) None

Removes allowlisted client to listen for.

Parameters:

ip_address (str) –

remove_whitelisted_client(ip_address: str) None

deprecated: ‘remove_whitelisted_client’ was renamed to ‘remove_allowlisted_client’.

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) –

Return type:

bool

set_allowlist_clients_enabled(enabled) None

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

Parameters:

enabled (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: bool) None

deprecated: ‘set_whitelist_clients_enabled’ was renamed to ‘set_allowlist_clients_enabled’.

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: