network_data_transfer library
This library allows Client-Server communication with service discovery and abstracts communication primitives and communication data using Packets.
You can receive multicast/broadcast discovery/advertisement events with DeviceDiscoveryListener as well as receive reliable communication events using ConnectionListener. Create Servers using the Server class and clients using the Client class.
Classes
- Client
- A Client connects to a Server and can discover Servers listening on the network
- ConnectionListener
- Classes that implements this can listen and get notified when there's a connection/disconnection on any device as well as message received. [...]
- Device
- A Device has an IP address and connects over a port. The design does not currently allow multiple connections using different ports from the same device. [...]
- DeviceDiscoveryListener
- This interface allows you to listen to events from multicast group used for service discovery and advertisement. [...]
- Host
- A Host is a generic endpoint (STA/AP) in the network. A Client and a Server are both hosts.
- Packet
- This class models the raw data that needs to be sent or received over the network. and is just a wrapper around the raw bytes/stream. [...]
- Server
- A Server listens for connections and keeps a list of all the connected devices
Enums
- IPVersion
- The supported IP version to use
Typedefs
-
CustomAdvertisement(
int socketPort) → Packet - This is used to create a custom advertisement message. [...]
-
ListenOn(
Future< Iterable< interfaceAddresses) → Future<Map< >NetworkInterface, Iterable< >InternetAddress> >String> - For the socket connection to the Server, this allows you to specify the IP address which the Server should listen on. [...]