… | |
… | |
3 | Coro::Socket - non-blocking socket-io |
3 | Coro::Socket - non-blocking socket-io |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use Coro::Socket; |
7 | use Coro::Socket; |
|
|
8 | |
|
|
9 | # listen on an ipv4 socket |
|
|
10 | my $socket = new Coro::Socket PeerHost => "localhost", |
|
|
11 | PeerPort => 'finger'; |
|
|
12 | |
|
|
13 | # listen on any other type of socket |
|
|
14 | my $socket = Coro::Socket->new_from_fh |
|
|
15 | (IO::Socket::UNIX->new |
|
|
16 | Local => "/tmp/socket", |
|
|
17 | Type => SOCK_STREAM, |
|
|
18 | ); |
8 | |
19 | |
9 | =head1 DESCRIPTION |
20 | =head1 DESCRIPTION |
10 | |
21 | |
11 | This module implements socket-handles in a coroutine-compatible way, |
22 | This module implements socket-handles in a coroutine-compatible way, |
12 | that is, other coroutines can run while reads or writes block on the |
23 | that is, other coroutines can run while reads or writes block on the |