reset events flags after reading from socket