
I was programming some RCON client to connect to a factorio server's remote console.
The program didn't write RCON-packets at one go but rather piecewise to the TCP buffer. Subsequently the server writes something along 'Couldn't parse RCON data: Couldn't read from input file. File could be corrupted.' to the log, even though my programm hasn't disconnected.
It probably expect the TCP buffer to contain at least the amount of data it wants to read, which isn't guaranteed by TCP. The TCP stack may arbitrarily transfer data from one peer to another. Thus, server should perform reads until the requested amount of data has been received.
I temporarily fixed the problem by writing packets at once.