Add timeout to receiving file packets

Now need some improvements.
First: little bug when cancelation file receiving, app sometimes create
a file with a size of file packet.
Second: Need to cancel sending file if acknowledge of packets not come.