Refactor cancelReceivingFile to cancel receiving current file rather
then close the connection.