/[meteor]/googlecode.com/svn/trunk/Meteor/Subscriber.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /googlecode.com/svn/trunk/Meteor/Subscriber.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by andrew.betts, Thu Dec 20 21:24:24 2007 UTC revision 44 by knops.gerd, Sun Feb 3 23:53:55 2008 UTC
# Line 44  package Meteor::Subscriber; Line 44  package Meteor::Subscriber;
44                    
45          our %PersistentConnections=();          our %PersistentConnections=();
46          our $NumAcceptedConnections=0;          our $NumAcceptedConnections=0;
47        
48    
49  ###############################################################################  ###############################################################################
50  # Factory methods  # Factory methods
# Line 79  sub deleteSubscriberWithID { Line 80  sub deleteSubscriberWithID {
80                    
81          if(exists($PersistentConnections{$id}))          if(exists($PersistentConnections{$id}))
82          {          {
83                  $PersistentConnections{$id}->close(1);                  $PersistentConnections{$id}->close();
84          }          }
85  }  }
86    
# Line 152  sub processLine { Line 153  sub processLine {
153                          my $channels={};                          my $channels={};
154                          my $channelName;                          my $channelName;
155                          my $offset;                          my $offset;
156                          foreach my $chandef (@channelData)                          foreach my $chandef (@channelData) {
157                          {                                  if($chandef=~/^([a-z0-9]+)(.(r|b|h)([0-9]*))?$/i) {
                                 if($chandef=~/^([a-z0-9]+)(.(r|b|h)([0-9]*))?$/)  
                                 {  
158                                          $channelName = $1;                                          $channelName = $1;
159                                          $channels->{$channelName}->{'startIndex'} = undef;                                          $channels->{$channelName}->{'startIndex'} = undef;
160                                          for ($3) {                                          if ($3) {
161                                                  $offset = $4;                                             $offset = $4;
162                                                  /r/ && do { $channels->{$channelName}->{'startIndex'} = $offset; last; };                                             if ($3 eq 'r') { $channels->{$channelName}->{'startIndex'} = $offset; }
163                                                  /b/ && do { $channels->{$channelName}->{'startIndex'} = -$offset; last; };                                             if ($3 eq 'b') { $channels->{$channelName}->{'startIndex'} = -$offset; }
164                                                  /h/ && do { $channels->{$channelName}->{'startIndex'} = 0; last; };                                             if ($3 eq 'h') { $channels->{$channelName}->{'startIndex'} = 0; }
165                                          }                                          }
166                                  }                                  }
167                          }                          }
# Line 345  sub close { Line 344  sub close {
344                  }                  }
345          }          }
346                    
         $::Statistics->{'current_subscribers'}--;  
           
347          $self->SUPER::close();          $self->SUPER::close();
348  }  }
349    
350    sub didClose {
351            
352            $::Statistics->{'current_subscribers'}--;
353    }
354    
355  sub checkForMaxTime {  sub checkForMaxTime {
356          my $self=shift;          my $self=shift;
357          my $time=shift;          my $time=shift;

Legend:
Removed from v.32  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26