0
|
1 use v6.c;
|
|
2 unit class Abyss::Server:ver<0.0.1>:auth<cpan:ANATOFUZ>;
|
|
3
|
|
4 use MONKEY-SEE-NO-EVAL;
|
|
5
|
|
6 method readeval {
|
|
7 my $listen = IO::Socket::INET.new( :listen,
|
|
8 :localhost<localhost>,
|
|
9 :localport(3333) );
|
|
10 my $counter = 0;
|
|
11 my $now = DateTime.now(formatter => { sprintf "%03d:%03d:%03d", .hour, .minute ,.second});
|
|
12 loop {
|
|
13 my $conn = $listen.accept;
|
|
14 while my $buf = $conn.read(1024) {
|
|
15 EVALFILE $buf.decode;
|
|
16 $counter++;
|
|
17 }
|
|
18 $conn.close;
|
|
19
|
|
20 if ($counter == 100) {
|
|
21 last;
|
|
22 }
|
|
23 }
|
|
24 $now = DateTime.now(formatter => { sprintf "%03d:%03d:%03d", .hour, .minute ,.second});
|
|
25 say $now;
|
|
26
|
|
27 }
|
|
28
|
|
29
|
|
30 =begin pod
|
|
31
|
|
32 =head1 NAME
|
|
33
|
|
34 Abyss::Server - blah blah blah
|
|
35
|
|
36 =head1 SYNOPSIS
|
|
37
|
|
38 =begin code :lang<perl6>
|
|
39
|
|
40 use Abyss::Server;
|
|
41
|
|
42 =end code
|
|
43
|
|
44 =head1 DESCRIPTION
|
|
45
|
|
46 Abyss::Server is ...
|
|
47
|
|
48 =head1 AUTHOR
|
|
49
|
|
50 AnaTofuZ <anatofuz@gmail.com>
|
|
51
|
|
52 =head1 COPYRIGHT AND LICENSE
|
|
53
|
|
54 Copyright 2020 AnaTofuZ
|
|
55
|
|
56 This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
|
|
57
|
|
58 =end pod
|