Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!perl6
- use v6;
- my Buf $buf;
- await IO::Socket::Async.connect('test.mosquitto.org',1883).then( -> $p {
- if $p.status {
- given $p.result {
- react {
- .write(pack("C C n a* C C n n a*", 16, 15, 6, "MQIsdp", 3, 2, 60, 1, "a"));
- my $bs = .bytes-supply;
- whenever $bs -> $received {
- $received.WHAT.say;
- $buf ~= $received;
- }
- }
- .close;
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement