Optimize writeMessage logic.
Simplify session timeout logic.
Optimize file transfer logic.
Add mapped access mode to receiving file function.