add message loss detection
Merge pull request #189 from huafengw/msg_lost

add message lost detection