1 | #!/usr/bin/perl |
1 | #!/usr/bin/perl |
2 | |
2 | |
3 | # this hack shows how one can overwrite |
3 | # this hack shows how one can overwrite IO::Socket::INET to provide |
4 | # IO::Socket::INET to provide non-blocking sockets by default. |
4 | # non-blocking sockets by default. This makes lwp magically |
5 | # this makes lwp magically non-blocking. I hope. |
5 | # non-blocking. I hope. |
6 | |
6 | |
7 | { |
7 | { |
8 | # this is all the required magic: we replace the constructor. |
8 | # this is all the required magic: we replace the constructor. |
9 | use Coro::Socket; |
9 | use Coro::Socket; |
10 | use IO::Socket::INET; |
10 | use IO::Socket::INET; |