… | |
… | |
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.3; |
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; |
… | |
… | |
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). |
… | |
… | |
1371 | sub starttls { |
1375 | sub starttls { |
1372 | my ($self, $ssl, $ctx) = @_; |
1376 | my ($self, $ssl, $ctx) = @_; |
1373 | |
1377 | |
1374 | require Net::SSLeay; |
1378 | require Net::SSLeay; |
1375 | |
1379 | |
1376 | Carp::croak "it is an error to call starttls more than once on an Anyevent::Handle object" |
1380 | Carp::croak "it is an error to call starttls more than once on an AnyEvent::Handle object" |
1377 | if $self->{tls}; |
1381 | if $self->{tls}; |
1378 | |
1382 | |
1379 | if ($ssl eq "accept") { |
1383 | if ($ssl eq "accept") { |
1380 | $ssl = Net::SSLeay::new ($ctx || TLS_CTX ()); |
1384 | $ssl = Net::SSLeay::new ($ctx || TLS_CTX ()); |
1381 | Net::SSLeay::set_accept_state ($ssl); |
1385 | Net::SSLeay::set_accept_state ($ssl); |