//We send state information every this often//If peer doesn't respond in two heartbeats, it is 'dead'#define HEARTBEAT 1000//In msecs

//States we can be in at any point in timetypedefenum {STATE_PRIMARY =1,//Primary, waiting for peer to connectSTATE_BACKUP =2,//Backup, waiting for peer to connectSTATE_ACTIVE =3,//Active - accepting connectionsSTATE_PASSIVE =4//Passive - not accepting connections
} state_t;