Client class
A Client connects to a Server and can discover Servers listening on the network
Constructors
- Client({String name, int multicastPort, String multicastGroupIP, IPVersion ipVersion, DeviceDiscoveryListener deviceDiscoveryListener, ConnectionListener connectionListener})
- See Host for explanation on all the common options.
Properties
- connected → bool
-
Check if the Client is connected to the Server and can start sending and
receiving messages.
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
-
interfaceAddresses
→ Future<
Iterable< Map< >NetworkInterface, Iterable< >InternetAddress> > -
Get a Map of all the interfaces and IP addresses found in the interfaces
read-only, inherited
-
interfaces
→ Future<
List< NetworkInterface> > -
Get all the interfaces found in this Host
read-only, inherited
- ipAddress → String
-
Get the first detected IP address which the host could listen on (if Server)
or connect using (if Client)
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 being used
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
-
ready
→ Future<
bool> -
If the Host (Client/Server) has completed it's initialization phase
and is ready to start advertising/discovering services. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
connectTo(
Device device, {String ipAddress}) → void -
The client can connect to the Server that is already listening for connection.
ipAddress
is the IP to use in connecting to the server if the default detected one is not the interface you want to use.ipAddress
is not validated for correctness or if really it is owned by this Device All IP addresses for host can be obtained using the ipAddresses property -
disconnect(
) → Future< void> -
Use this for housekeeping to disconnect this Client from the Server
override
-
discoverHosts(
[Future< bool> precondition]) → Future<bool> - Client searches for AP hosts (Servers). The Client joins a multicast group to listens for advertisements. This method returns boolean future that indicates if the client was able to join the multicast group. [...]
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
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
-
stopDiscovery(
) → void - A way to stop the Client from further listening on multicast discovery messages. This is particularly useful when you have found the host with the required service.
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited