added loopIn event, modify loopEnd event, emit close event before retrying connection
0.2.0