43 |
@Meteor::Subscriber::ISA=qw(Meteor::Connection); |
@Meteor::Subscriber::ISA=qw(Meteor::Connection); |
44 |
|
|
45 |
our %PersistentConnections=(); |
our %PersistentConnections=(); |
46 |
|
our $NumAcceptedConnections=0; |
47 |
|
|
48 |
############################################################################### |
############################################################################### |
49 |
# Factory methods |
# Factory methods |
64 |
$self->{'ConnectionTimeLimit'}=$self->{'ConnectionStart'}+$maxTime; |
$self->{'ConnectionTimeLimit'}=$self->{'ConnectionStart'}+$maxTime; |
65 |
} |
} |
66 |
|
|
67 |
|
$::Statistics->{'current_subscribers'}++; |
68 |
|
$::Statistics->{'subscriber_connections_accepted'}++; |
69 |
|
|
70 |
$self; |
$self; |
71 |
} |
} |
72 |
|
|
101 |
map { $_->checkForMaxTime($time) } @cons; |
map { $_->checkForMaxTime($time) } @cons; |
102 |
} |
} |
103 |
|
|
104 |
|
sub numSubscribers { |
105 |
|
|
106 |
|
return scalar(keys %PersistentConnections); |
107 |
|
} |
108 |
|
|
109 |
############################################################################### |
############################################################################### |
110 |
# Instance methods |
# Instance methods |
111 |
############################################################################### |
############################################################################### |
280 |
my $self=shift; |
my $self=shift; |
281 |
|
|
282 |
$self->emitHeader('404 Not Found'); |
$self->emitHeader('404 Not Found'); |
283 |
|
$::Statistics->{'errors_served'}++; |
284 |
|
|
285 |
# close up shop here! |
# close up shop here! |
286 |
$self->close(); |
$self->close(); |
328 |
sub sendMessage { |
sub sendMessage { |
329 |
my $self=shift; |
my $self=shift; |
330 |
my $msg=shift; |
my $msg=shift; |
331 |
|
my $numMsgInThisBatch=shift; |
332 |
|
|
333 |
|
$numMsgInThisBatch=1 unless(defined($numMsgInThisBatch)); |
334 |
|
|
335 |
$self->write($msg); |
$self->write($msg); |
336 |
|
|
337 |
|
$::Statistics->{'messages_served'}+=$numMsgInThisBatch; |
338 |
|
|
339 |
my $msgCount=++$self->{'MessageCount'}; |
my $msgCount=++$self->{'MessageCount'}; |
340 |
|
|
341 |
my $maxMsg=$::CONF{'MaxMessages'}; |
my $maxMsg=$::CONF{'MaxMessages'}; |
393 |
} |
} |
394 |
} |
} |
395 |
|
|
396 |
|
$::Statistics->{'current_subscribers'}--; |
397 |
|
|
398 |
$self->SUPER::close(); |
$self->SUPER::close(); |
399 |
} |
} |
400 |
|
|