Server class

A Server listens for connections and keeps a list of all the connected devices

Inheritance

Constructors

Server({String name, int multicastPort, IPVersion ipVersion, CustomAdvertisement customAdvertisement, DeviceDiscoveryListener deviceDiscoveryListener, ConnectionListener connectionListener, int serverSocketPort, bool enableDiscovery: true, ListenOn listenOn})
listenOn Allows you to provide the IP address the server should listen on for Client connections. If none is provided, the Server will listen on all IP address found for the supplied ipVersion [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
interfaceAddresses Future<Iterable<Map<NetworkInterface, Iterable<InternetAddress>>>>
read-only, inherited
interfaces Future<List<NetworkInterface>>
read-only, inherited
ipAddress String
Get the detected IP address
read-only, inherited
ipAddresses Future<Iterable<String>>
Get all IP addresses for all IP versions
read-only, inherited
ipv4Addresses Future<Iterable<String>>
Get all IP addresses for IPv4
read-only, inherited
ipv6Addresses Future<Iterable<String>>
Get all IP addresses for IPv6
read-only, inherited
multicastIPAddress String
Get the multicast Group IP Address
read-only, inherited
multicastPort int
Get the multicast port
read-only, inherited
name String
Get the name of this Host. Must have been set using the set property or constructor
read / write, inherited
port int
read-only
ready Future<bool>
If this device is ready to
read-only, inherited
running bool
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

broadcast(Packet packet, {bool reliable: false}) Future<void>
Send a broadcast using either the multicast group for unreliable and the connected client sockets for reliable broadcast
disconnect() Future<void>
Shutdown the Server by Disconnecting from all sockets
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
pauseDiscovery() → void
This allows pausing the discovery advertisements
resumeDiscovery() → void
You can resumed a paused discovery advertisement
send(Packet packet, Device device, {bool ignoreIfNotConnected: false}) → Future
Hosts can send messages to other devices using the internal socket contained in the Device. [...]
inherited
startDiscovery() → void
(Re)Start advertisements from this server to enable discovery on Clients
stopDiscovery() → void
Stop this Server from Advertising for Client discovery
toString() String
Returns a string representation of this object.
inherited

Operators

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