use strict;
use State;

package State::IMIPChannel;

use vars qw/@ISA/;
@ISA = qw/State/;

sub enter {
    print "entering State::IMIPChannel\n";
}

sub exit {
    print "exiting State::IMIPChannel\n";
}

sub AUTOLOAD {
    my $self = shift;
    $self->state('State');
}


package State::IMIPChannel::New;
use vars qw/@ISA/;
@ISA = qw/State::IMIPChannel/;

sub enter {
    my ($self) = @_;
    print "entering State::IMIPChannel::New\n";
    Node->add_timeout($self, time+10, $self);
}

sub exit {
    my ($self) = @_;
    print "exiting State::IMIPChannel::New\n";
    Node->remove_timeout($self);
}

sub Hello_mid {
    my ($self, $channel, $my_ref, $your_ref, $fields) = @_;

    

    $self->to('mid');
}


package State::IMIPChannel::Active;
use vars qw/@ISA/;
@ISA = qw/State::IMIPChannel/;

sub enter {
    print "entering State::IMIPChannel::Active\n";
}

sub exit {
    print "exiting State::IMIPChannel::Active\n";
}

sub Goodbye {
    my $self = shift;
    $self->out;
}

1
