… | |
… | |
28 | $w->next; |
28 | $w->next; |
29 | print "."; |
29 | print "."; |
30 | }; |
30 | }; |
31 | } |
31 | } |
32 | |
32 | |
|
|
33 | sub finger : Coro { |
|
|
34 | use IO::Socket::INET; |
|
|
35 | # is there ANY way to do non-blocking connects with IO::Socket::INET? |
|
|
36 | # I don't see how... |
|
|
37 | my $io = new IO::Socket::INET PeerAddr => "noc.dfn.de:finger"; |
|
|
38 | print "connected, sending\n"; |
|
|
39 | syswrite $io, "trouble\n"; |
|
|
40 | my $r = Coro::Event->io(fd => $io, poll => 'r'); |
|
|
41 | my $buf; |
|
|
42 | $r->next while 0 != sysread $io, $buf, 8192, length $buf; |
|
|
43 | print $buf; |
|
|
44 | do_timer(after => 60); |
|
|
45 | } |
|
|
46 | |
33 | Coro::Event->main; |
47 | Coro::Event->main; |
34 | |
48 | |