Basically the only thing that needs to be done is not to mistake a 8 byte length encoded integer as an EOF packet.