title: FTP STOR command, how do I know if all the data was sent?
body: <p>I'm trying to build a simple FTP server, but for the STOR command I'm not sure how to distinguish between the data connection closing because all the data was sent, or if the data connection closed prematurely. </p>
  
  <p>In the RETR command, I know the size of the file I'm sending, but in the STOR command, I don't know how many bytes I should receive.</p>
  
  <p>And if the data connection closes prematurely, what should the FTP server do?</p>