Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- method connect () {
- start {
- my $conn = await IO::Socket::Async.connect($!host, $!port);
- $!incoming = self!process-messages($conn.Supply(:bin));
- await $!incoming;
- $!connection = $conn;
- True
- }
- }
- method login () {
- say $!connection.write(0xffdeadbeef);
- say 'foo';
- }
- method !process-messages($incoming) {
- supply {
- my @chars = '';
- whenever $incoming -> $data {
- say $data.unpack('H');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement