//Process to listen incomming packets from other Servers. func processInbox(server cluster.Server, SM *sm.State_Machine) { for { env := <-server.Inbox() switch env.Msg.(type) { case sm.VoteReq: SM.CommMedium.NetCh <- env.Msg case sm.VoteResp: SM.CommMedium.NetCh <- env.Msg case sm.AppEntrReq: SM.CommMedium.NetCh <- env.Msg case sm.AppEntrResp: SM.CommMedium.NetCh <- env.Msg } } }