Hi everyone,
Thanks for the great work on the library so far. I'm trying to build a state machine for a TCP stack.
There are some states which can transition to two other states depending on the data that was passed to it. In my example code below, I can go from the 'SynRcvd' state to either the 'Established' or 'Listen' states depending on the content of the packet that was received. But I'm not sure how to represent that in the state machine. Do I need to parse the packets outside the state machine and turn my single 'PacketReceived' event into more fine-grained events?
enum FSMEvent
{
PacketReceived, PacketSent, Timeout2MSL, Timeout, Close
}
public class TCPStack extends AbstractUntypedStateMachine
{
protected void transitFromSynRcvdToEstablishedOnPacketReceived(String from, String to, FSMEvent event, TCPPacket packet) {}
protected void transitFromSynRcvdToListenOnPacketReceived(String from, String to, FSMEvent event, TCPPacket packet) {}
}
Also, when I use the 'convention over configuration'-style transitions like above, does the FSM automatically generate the list of states, or do I need to define those somewhere?
thanks,
imran