/[Frey]/trunk/lib/Frey/Server.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 /trunk/lib/Frey/Server.pm

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

revision 23 by dpavlin, Sun Jun 29 16:24:41 2008 UTC revision 26 by dpavlin, Sun Jun 29 18:08:50 2008 UTC
# Line 8  use Continuity::REPL; Line 8  use Continuity::REPL;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9    
10  use base 'Frey';  use base 'Frey';
   
11  use Frey::HTML;  use Frey::HTML;
12    
13  my @messages;    # Global (shared) list of messages  my @messages;    # Global (shared) list of messages
14  my $got_message; # Flag to indicate that there is a new message to display  my $got_message; # Flag to indicate that there is a new message to display
15    
16  use vars qw( $repl $server );  use vars qw( $repl $server );
 $repl = Continuity::REPL->new;  
17    
18  $server = Continuity->new(  sub run {
19    port => 16001,          $repl = Continuity::REPL->new;
20    path_session => 1,          $server = Continuity->new(
21    cookie_session => 'sid',            port => 16001,
22    callback => \&main,            path_session => 1,
23  );            cookie_session => 'sid',
24  $server->debug_level( 2 );            callback => \&main,
25            );
26            $server->debug_level( 2 );
27    
28  $server->loop;          $server->loop;
29    }
30    
31  # This is the main entrypoint. We are looking for one of three things -- a  # This is the main entrypoint. We are looking for one of three things -- a
32  # pushstream, a sent message, or a request for the main HTML. We delegate each  # pushstream, a sent message, or a request for the main HTML. We delegate each
# Line 114  sub send_page { Line 115  sub send_page {
115                  } else {                  } else {
116                          my $html = Frey::HTML->page( 'status' );                          my $html = Frey::HTML->page( 'status' );
117                          $req->print( $html );                          $req->print( $html );
118                          warn ">> ",length( $html ), " bytes\n";                          warn ">> ",length( $html ), " bytes | ", substr($html, 0, 80),$/;
119                  }                  }
120                  $req->next;                  $req->next;
                 Module::Refresh->refresh;  
121          }          }
122  }  }
123    
124    1;

Legend:
Removed from v.23  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26