… | |
… | |
14 | |
14 | |
15 | AnyEvent::Handle - non-blocking I/O on file handles via AnyEvent |
15 | AnyEvent::Handle - non-blocking I/O on file handles via AnyEvent |
16 | |
16 | |
17 | =cut |
17 | =cut |
18 | |
18 | |
19 | our $VERSION = 4.31; |
19 | our $VERSION = 4.33; |
20 | |
20 | |
21 | =head1 SYNOPSIS |
21 | =head1 SYNOPSIS |
22 | |
22 | |
23 | use AnyEvent; |
23 | use AnyEvent; |
24 | use AnyEvent::Handle; |
24 | use AnyEvent::Handle; |
… | |
… | |
27 | |
27 | |
28 | my $handle = |
28 | my $handle = |
29 | AnyEvent::Handle->new ( |
29 | AnyEvent::Handle->new ( |
30 | fh => \*STDIN, |
30 | fh => \*STDIN, |
31 | on_eof => sub { |
31 | on_eof => sub { |
32 | $cv->broadcast; |
32 | $cv->send; |
33 | }, |
33 | }, |
34 | ); |
34 | ); |
35 | |
35 | |
36 | # send some request line |
36 | # send some request line |
37 | $handle->push_write ("getinfo\015\012"); |
37 | $handle->push_write ("getinfo\015\012"); |
… | |
… | |
374 | } |
374 | } |
375 | |
375 | |
376 | =item $handle->autocork ($boolean) |
376 | =item $handle->autocork ($boolean) |
377 | |
377 | |
378 | Enables or disables the current autocork behaviour (see C<autocork> |
378 | Enables or disables the current autocork behaviour (see C<autocork> |
379 | constructor argument). |
379 | constructor argument). Changes will only take effect on the next write. |
380 | |
380 | |
381 | =cut |
381 | =cut |
|
|
382 | |
|
|
383 | sub autocork { |
|
|
384 | $_[0]{autocork} = $_[1]; |
|
|
385 | } |
382 | |
386 | |
383 | =item $handle->no_delay ($boolean) |
387 | =item $handle->no_delay ($boolean) |
384 | |
388 | |
385 | Enables or disables the C<no_delay> setting (see constructor argument of |
389 | Enables or disables the C<no_delay> setting (see constructor argument of |
386 | the same name for details). |
390 | the same name for details). |