/[cwmp]/google/trunk/lib/CWMP/Session.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 /google/trunk/lib/CWMP/Session.pm

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

revision 72 by dpavlin, Wed Jun 20 23:48:45 2007 UTC revision 77 by dpavlin, Fri Jun 22 13:09:08 2007 UTC
# Line 8  use base qw/Class::Accessor/; Line 8  use base qw/Class::Accessor/;
8  __PACKAGE__->mk_accessors( qw/  __PACKAGE__->mk_accessors( qw/
9  debug  debug
10  port  port
11    store_path
12    
13  sock  sock
14  state  state
15  queue  queue
16    store
17  / );  / );
18    
19  use IO::Socket::INET;  use IO::Socket::INET;
20  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
21    use Carp qw/confess cluck croak/;
22    
23  use CWMP::Request;  use CWMP::Request;
24  use CWMP::Response;  use CWMP::Response;
25  use Carp qw/confess cluck/;  use CWMP::Store;
26    
27  =head1 NAME  =head1 NAME
28    
# Line 27  CWMP::Server - implement logic of CWMP p Line 32  CWMP::Server - implement logic of CWMP p
32    
33  =head2 new  =head2 new
34    
35    my $server = CWMP::Server->new({ port => 3333 });    my $server = CWMP::Server->new({
36            port => 3333,
37            store_path => 'state.db',
38            debug => 1,
39      });
40    
41  =head2 run  =head2 run
42    
# Line 51  sub run { Line 60  sub run {
60                  $self->queue ? " queue ( " . join(",",@{$self->queue}) . " )" : "",                  $self->queue ? " queue ( " . join(",",@{$self->queue}) . " )" : "",
61                  "\n";                  "\n";
62    
63            $self->debug( 0 ) unless $self->debug;
64          warn "## debug level: ", $self->debug, "\n" if $self->debug;          warn "## debug level: ", $self->debug, "\n" if $self->debug;
65    
66            $self->store( CWMP::Store->new({
67                    debug => $self->debug,
68                    path => $self->store_path,
69            }) );
70            croak "can't open ", $self->store_path, ": $!" unless $self->store;
71    
72          while ( my $sock = $listen->accept ) {          while ( my $sock = $listen->accept ) {
73                  $sock->autoflush(1);                  $sock->autoflush(1);
74    

Legend:
Removed from v.72  
changed lines
  Added in v.77

  ViewVC Help
Powered by ViewVC 1.1.26