line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Discard.pm,v 1.3 2005/01/27 10:55:49 chris Exp $ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# POE::Component::Server::Echo, by Chris 'BinGOs' Williams |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# This module may be used, modified, and distributed under the same |
6
|
|
|
|
|
|
|
# terms as Perl itself. Please see the license that came with your Perl |
7
|
|
|
|
|
|
|
# distribution for details. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
package POE::Component::Server::Discard; |
11
|
|
|
|
|
|
|
$POE::Component::Server::Discard::VERSION = '1.16'; |
12
|
|
|
|
|
|
|
#ABSTRACT: A POE component that implements an RFC 863 Discard server. |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
26935
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
15
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
47
|
|
16
|
2
|
|
|
2
|
|
7
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
175
|
|
17
|
2
|
|
|
2
|
|
830
|
use POE; |
|
2
|
|
|
|
|
64554
|
|
|
2
|
|
|
|
|
11
|
|
18
|
2
|
|
|
2
|
|
87348
|
use base qw(POE::Component::Server::Echo); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
943
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
30821
|
use constant DATAGRAM_MAXLEN => 1024; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
86
|
|
21
|
2
|
|
|
2
|
|
7
|
use constant DEFAULT_PORT => 9; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
196
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _client_input { |
24
|
1
|
|
|
1
|
|
4782
|
return; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _get_datagram { |
28
|
1
|
|
|
1
|
|
2949
|
my ( $kernel, $socket ) = @_[ KERNEL, ARG0 ]; |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
12
|
my $remote_address = recv( $socket, my $message = "", DATAGRAM_MAXLEN, 0 ); |
31
|
1
|
50
|
|
|
|
5
|
return unless defined $remote_address; |
32
|
1
|
|
|
|
|
2
|
undef; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
qq[Throw it away, throw it away now]; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |