On Sat, Sep 9, 2017 at 7:39 AM, Juliusz Chroboczek <j...@irif.fr> wrote: > > I've got a bufio.Writer which is wrapping a net.TCPConn. Once in > a while, Flush() will trigger a write timeout (set with SetWriteDeadline > on the underlying connection), in which case I'd like to reschedule some > requests on a different connection, and then restart the Flush() with > a more relaxed timeout. > > Looking at the sources of bufio.Writer.Flush(), I don't see how I can > get that to work. The first timeout sets the b.err field to a non-nil > value, and as far as I can tell this field will never get cleared. > > Is there a way to deal gracefully with timeouts without rewriting > bufio.Writer from scratch?
bufio.Writer is about 200 lines, and you probably don't even need all of them. Just copy it and modify it for your purposes. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.