Newer
Older
type idleState struct {
fsm *FSM2
newStateReason string
}
func newIdleState(fsm *FSM2) *idleState {
return &idleState{
fsm: fsm,
}
}
func (s idleState) run() (state, string) {
if s.fsm.peer.reconnectInterval != 0 {
time.Sleep(s.fsm.peer.reconnectInterval)
go s.fsm.activate()
}
return s.automaticStart()
case Cease:
return newCeaseState(), "Cease"
s.fsm.resetConnectRetryCounter()
s.fsm.startConnectRetryTimer()
go s.fsm.tcpConnect()
return newConnectState(s.fsm), s.newStateReason