pin / tftp

TFTP server and client library for Golang
MIT License
288 stars 74 forks source link

Read and Write handler have been made public and OnError function have been added to handle returned errors. #40

Closed dgrr closed 4 years ago

pin commented 5 years ago

Hi,

Sorry for such a long delay with the answer!

Why do you think it worth exposing WriteHandler and ReadHandler? My concern is that it makes API of the library is more hairy with no benefit for the user. User passed that functions to the library, why user would like to get them back?

Maybe to replace them on the go? But it leads to race condition when handler is executed and replaced at the same time?

OnError though looks interesting, except it should be SetErrorHandler or something so we can put proper locking.

What do you think?

And thank you for the diff, sorry for slow response again. Life happens :)