OscUdpSocket class

A unified UDP socket for OSC communication

Provides both event-driven (streams) and direct control (receive methods) approaches for maximum flexibility.

Constructors

OscUdpSocket()

Properties

hashCode int
The hash code for this object.
no setterinherited
isBound bool
Returns true if the socket is bound and ready for communication
no setter
isEventDriven bool
Returns true if event-driven mode is active
no setter
localAddress InternetAddress?
The local address the socket is bound to (null if not bound)
no setter
localPort int?
The local port the socket is bound to (null if not bound)
no setter
onError Stream<OscErrorEvent>?
Stream of errors (only available when using event-driven mode)
no setter
onPacket Stream<OscPacketEvent>?
Stream of received OSC packets (only available when using event-driven mode)
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socket RawDatagramSocket?
The underlying UDP socket (null if not bound)
no setter

Methods

bind({int port = 0, InternetAddress? address, bool eventDriven = false, bool reuseAddress = true, bool reusePort = false, int ttl = 1}) Future<void>
Binds the socket to a local address and port
close() Future<void>
Closes the socket and cleans up resources
disableEventDrivenMode() Future<void>
Disables event-driven mode and stops automatic packet handling
joinMulticast(InternetAddress group, [NetworkInterface? interface]) Future<void>
Multicast support
leaveMulticast(InternetAddress group, [NetworkInterface? interface]) Future<void>
Multicast support
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
receivePacket([Duration? timeout]) Future<OscPacketEvent?>
Receives a single OSC packet (only available in direct mode)
sendPacket(OscPacket packet, InternetAddress address, int port) int
Sends an OSC packet to the specified destination
sendToHost(OscPacket packet, String hostname, int port) Future<int>
Sends an OSC packet to a hostname on the specified port
sendToLocalHost(OscPacket packet, int port) Future<int>
Convenience methods for sending
setBroadcast({required bool enabled}) → void
Socket configuration
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited