parse messages, pong when pinged