In this link described how print all Datagrams when sending a broadcast UDP packet. But how to receive a list of them? I'm try this
List<Datagram> list = [];
...
socket.listen(event) {
list.add(socket.receive());
}
...
return list;
but this is not works.
socket.close();
await socket.toList();
save a list of events with just one event of closing them. Is there any way to save a list of datagrams?