Added file transmission completion and connection closure