I think I found the error, I do execute read and write asynchronously. If the server respondes with a bigger delay, I get errors.