53 |
my $wVecRef=shift; |
my $wVecRef=shift; |
54 |
my $eVecRef=shift; |
my $eVecRef=shift; |
55 |
|
|
56 |
map {$_->addHandleBits($rVecRef,$wVecRef,$eVecRef)} @Connections; |
my @cons=@Connections; |
57 |
|
map {$_->addHandleBits($rVecRef,$wVecRef,$eVecRef) if(defined($_)) } @cons; |
58 |
} |
} |
59 |
|
|
60 |
sub checkAllHandleBits { |
sub checkAllHandleBits { |
64 |
my $wVec=shift; |
my $wVec=shift; |
65 |
my $eVec=shift; |
my $eVec=shift; |
66 |
|
|
67 |
map {$_->checkHandleBits($rVec,$wVec,$eVec)} @Connections; |
my @cons=@Connections; |
68 |
|
map {$_->checkHandleBits($rVec,$wVec,$eVec) if(defined($_)) } @cons; |
69 |
} |
} |
70 |
|
|
71 |
sub connectionCount { |
sub connectionCount { |
98 |
# |
# |
99 |
my $self=shift->new(); |
my $self=shift->new(); |
100 |
|
|
101 |
|
$::Statistics->{'total_requests'}++; |
102 |
|
|
103 |
my $server=shift; |
my $server=shift; |
104 |
my $socket=$server->conSocket(); |
my $socket=$server->conSocket(); |
105 |
|
|
184 |
my $bytesRead=sysread($socket->{'handle'},$buffer,$MAX_READ_SIZE); |
my $bytesRead=sysread($socket->{'handle'},$buffer,$MAX_READ_SIZE); |
185 |
if(defined($bytesRead) && $bytesRead>0) |
if(defined($bytesRead) && $bytesRead>0) |
186 |
{ |
{ |
187 |
|
$::Statistics->{'total_inbound_bytes'}+=$bytesRead; |
188 |
$self->{'readBuffer'}.=$buffer; |
$self->{'readBuffer'}.=$buffer; |
189 |
while($self->{'readBuffer'}=~s/^([^\r\n]*)\r?\n//) |
while($self->{'readBuffer'}=~s/^([^\r\n]*)\r?\n//) |
190 |
{ |
{ |
223 |
|
|
224 |
if(defined($bytesWritten) && $bytesWritten>0) |
if(defined($bytesWritten) && $bytesWritten>0) |
225 |
{ |
{ |
226 |
|
$::Statistics->{'total_outbound_bytes'}+=$bytesWritten; |
227 |
$self->{'writeBuffer'}=substr($self->{'writeBuffer'},$bytesWritten); |
$self->{'writeBuffer'}=substr($self->{'writeBuffer'},$bytesWritten); |
228 |
if(length($self->{'writeBuffer'})==0) |
if(length($self->{'writeBuffer'})==0) |
229 |
{ |
{ |
297 |
} |
} |
298 |
|
|
299 |
&::syslog('debug',"Closed %s for %s",ref($self),$self->{'socket'}->{'connection'}->{'remoteIP'}); |
&::syslog('debug',"Closed %s for %s",ref($self),$self->{'socket'}->{'connection'}->{'remoteIP'}); |
300 |
|
|
301 |
|
$self->didClose(); |
302 |
|
} |
303 |
|
|
304 |
|
sub didClose { |
305 |
} |
} |
306 |
|
|
307 |
1; |
1; |