I like it, one addition you can add is write all the new messages to a file, and then whenever there's a sockerr, you can just read from that file.