Skip to content

Instantly share code, notes, and snippets.

@rsolomo
Last active November 20, 2018 03:37
Show Gist options
  • Save rsolomo/8779574 to your computer and use it in GitHub Desktop.
Save rsolomo/8779574 to your computer and use it in GitHub Desktop.
trying out a UDP listener in Dart
import 'dart:io';
void main() {
RawDatagramSocket.bind('127.0.0.1', 5514, reuseAddress: true).then((value) {
value.listen((event) {
if (event == RawSocketEvent.READ) {
var datagram = value.receive();
print(new String.fromCharCodes(datagram.data));
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment