ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/06_loop_once.t
Revision: 1.1
Committed: Fri Dec 21 05:30:25 2007 UTC (16 years, 6 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-2_01, rel-2_0, rel-3_31, rel-3_33, rel-3_4, rel-3_3, rel-3_2, rel-3_1, rel-3_0, rel-3_44, rel-3_41, rel-3_42, rel-3_43, rel-3_48, rel-3_431
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 BEGIN { $| = 1; print "1..6\n"; }
2    
3     no warnings;
4     use strict;
5     use Socket;
6    
7     use EV;
8    
9     my $l = new EV::Loop;
10    
11     for my $i (3..5) {
12     $l->once (undef, 0, $i * 0.2, sub {
13     print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n";
14     });
15     }
16    
17     socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
18    
19     $l->once ($s1, EV::WRITE, 0.5, sub {
20     print $_[0] & EV::WRITE ? "" : "not ", "ok 2\n";
21     });
22    
23     print "ok 1\n";
24     $l->loop;
25     print "ok 6\n";