Server in single-port mode stops responding if non-existing file requested
When using single-port mode, using the provided sample code for the readHandler, as long as existing files are requested, everything works fine. When a non-existent file is requested, the open nofile: no such file or directory message is displayed, err is returned but then subsequent requests from the client are just ignored.
So it turns out this was due to a misbehaving tftp client, which was sending an unexpected ACK after an error was received from the server, corrupting the server status and preventing it from processing further packets. The RFC is pretty clear that error packets should not be acknowledged. Even if this is due to a bad client, I think the fix is simple and helps making the code more robust, so I've opened https://github.com/pin/tftp/pull/102 with what I believe is the fix.