This project has moved. For the latest updates, please go here.

TFTP server is hang up after some time

Nov 28, 2012 at 5:48 AM

Hi ,

I am using the TFTP server on windows. (windows 7 & 2008 ).  I am sending the frequent requests to the server for file transfer from different network devices to the server. But after some time(within 30 mins to 4 hrs after restarting) the TFTP server is hanging.  The server is not serving any of the requests and in the events logs also it is not populating anything once it hangs.  

To make the TFTP server available again I need to restart the TFTP service. 


Can anyone help here.




Feb 28, 2013 at 1:53 PM

I think I have a similar problem with the server as well.
After some time the server isn't serving any files but is shown as running. I couldn't find any hints in the Windows event logs about what is happening. I attached me to the process using Visual Studio Debugger but if I break I'm just landing in Program.cs: ServiceBase.Run(...
I can't step in or do anything else.

I really would appreciate some hints regarding this issue.
patilvv, do you have any new information to your problem? Could you solve it?
Feb 28, 2013 at 5:01 PM
  • which build are you using?
  • can you check the properties of the TFTP event log, specifically the maximum log size and the overwrite setting. (you can find it in control panel, administrative tools, event viewer, and then TFTP Server log, right click properties).
I'm asking about the log settings because I noticed that on some systems (for me, XP) the default setting is 'do not overwrite' or something similar. That causes the TFTP server to wait forever when the log is full. The correct setting should be 'overwrite events as needed'.
  • finally when this happens, do a netstat -a -n and check if the UDP port 69 is still listed in the result
Mar 1, 2013 at 7:52 AM

I built it on my own with Visual Studio 2010 using the latest source code from this site (94877).
I checked the event log settings. They are set properly to 'overwrite events as needed'.

netstat -a -n shows the following during successful downloads:
UDP local.ip.ip.ip:69 .
It doesen't change when the server is hanging.

I started a new test with around 2000 download-requests.
After around 500 I got the following error in the log:
INFO : TFTP : Aborted transfer to '', reason 'System.TimeoutException: Remote side didn't respond in time'
Thats the last message in the log.

From that time on all clients just abort every file request with:
Timeout occurred
Connect request failed

Any ideas?

Mar 1, 2013 at 11:51 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 2, 2013 at 12:03 AM
Edited Mar 2, 2013 at 12:04 AM
I managed to reproduce the problem by running the server in single-port mode and using multiple concurrent clients. The fix required some socket voodoo in UDPSocket.cs. See the latest changeset, just a few changes in UDPSocket.cs.
Mar 4, 2013 at 10:38 AM
Thank you very much for the provided patch.
I tested it and can confirm that this patch solves the described problem.

Thanks again for your great support on this issue.