Skip to content

Instantly share code, notes, and snippets.

@smls
Created August 6, 2016 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smls/ebd59307cb913777d1383708e4358625 to your computer and use it in GitHub Desktop.
Save smls/ebd59307cb913777d1383708e4358625 to your computer and use it in GitHub Desktop.

Start the following server program, and keep it running.

Then in another terminal run

telnet localhost 3333

...and press CTRL+C. This apparently sends some non-UTF8 bytes, because it causes the server to die as well, with the following message:

Unhandled exception: Malformed UTF-8
Command exited with non-zero status 1
#!/usr/bin/env perl6
react {
whenever IO::Socket::Async.listen('localhost', 3333) -> $conn {
whenever $conn.Supply -> $message {
say $message;
CATCH { default { say "ERROR: {.^name}"; } }
}
CATCH { default { say "ERROR: {.^name}"; } }
}
CATCH { default { say "ERROR: {.^name}"; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment