MessageCallbackMap class

A specialized callback map for handling messages from remote endpoints Supports both IPv4 and IPv6 addresses Key format:

  • IPv4: "192.168.1.100:8080"
  • IPv6: "2001:db8::1:8080"
Implementers

Constructors

MessageCallbackMap()

Properties

hashCode int
The hash code for this object.
no setterinherited
keys Iterable<String>
Get all keys with registered callbacks
no setter
length int
Get the number of registered callback keys
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(String key, MessageCallbackFunction callback) → void
Add a callback for a specific remote endpoint Key format: IPv4 "192.168.1.100:8080" or IPv6 "2001:db8::1:8080" If a callback already exists for this key, it will be replaced
addByAddress(InternetAddress address, int port, MessageCallbackFunction callback) → void
Add a callback using InternetAddress and port
clear() → void
Clear all registered callbacks
containsAddress(InternetAddress address, int port) bool
Check if an address:port combination has registered callbacks
containsKey(String key) bool
Check if a key has registered callbacks
get(String key) → MessageCallbackFunction?
Get a callback invoker for a specific remote endpoint Returns a function that invokes the registered callback for this key
getByAddress(InternetAddress address, int port) → MessageCallbackFunction?
Get a callback invoker using InternetAddress and port
getHandler(String key) CallbackOnMessage?
Get a callback invoker for a specific remote endpoint Returns a function that invokes the registered callback for this key
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key) → void
Remove the callback for a key
removeByAddress(InternetAddress address, int port) → void
Remove all callbacks using InternetAddress and port
removeCallback(String key, MessageCallbackFunction callback) → void
Remove the callback for a specific key
removeKey(String key) → void
Remove athe designed key
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

formatKey(InternetAddress address, int port) String
Format an InternetAddress and port into a key string Format:
parseKey(String key) → ({String address, int port})?
Parse a key string into address and port Supports both IPv4 and IPv6 formats: