msoulier / tftpy

Pure Python TFTP library
http://tftpy.sf.net
MIT License
172 stars 120 forks source link

Add the ability to configure the number of retransmission attempts after encountering a timeout #117

Closed algae12 closed 3 years ago

algae12 commented 3 years ago

Currently, the amount of retries is constant and defined as 5 in the TftpShared.py file. This branch adds the ability to configure the amount of retires.

msoulier commented 3 years ago

This is fine, although a test case would help. Mind you off the top of my head, I'm not sure how to confirm the number of retries during a transfer.

GrantEdwards commented 3 years ago

Setting retries to values larger than 20 doesn't work because MAX_DUPS is hard-wired to 20. On the 21st retry that causes an exception.

GrantEdwards commented 3 years ago

The easiest way to test the number of retries for a client upload/download is to attempt a transfer when the server isn't running.