go-pop3
go-pop3 copied to clipboard
fix read and write I/O timeout.
If the connected pop3 server port is not open, the timeout option will not take effect.
Thanks for the PR. This should ideally be new params called opt.ReadTimeout and opt.WriteTimeout. In addition, the timeouts should be reset on encountering ErrDeadlineExceeded.
By reset do you mean when the io.Reader or io.Writer encounters os.ErrDeadlineExceeded? I don't understand, thanks!
After a deadline has been exceeded, the connection can be refreshed by setting a deadline in the future.
It is explained in the comments here: https://pkg.go.dev/net#Conn
Basically, if a connection times out, if it has to be reused, its deadlines have to be set again.
Thanks for reply!