I am creating a TCP simulator in Python, however I am getting an error message on the lines self.availableStates["CLOSED"] = Closed(self) and the next 5 lines after.
Can anyone help?
The code where I am receiving the error is as follows:
class TCPSimulator(StateContext, Transition):
def __init__(self):
self.host = "127.0.0.1"
self.port = 5000
self.connection_address = 0
self.socket = None
self.commands = []
self.availableStates["CLOSED"] = Closed(self)
self.availableStates["ESTABLISHED"] = Established(self)
self.availableStates["SYNSENT"] = SynSent(self)
self.availableStates["FINWAIT1"] = FinWait1(self)
self.availableStates["FINWAIT2"] = FinWait2(self)
self.availableStates["TIMEDWAIT"] = TimedWait(self)
print ("Transitioning to Closed state!")
self.setState("CLOSED")