What is the ideal workflow when you need to read and write to a socket in random order?

You are referring to Very mysterious blockage in tokio?