Can you wrap the call to scanner.Scan in a func that has access to the ccn context and returns false when it's closed?
On Thu, 2018-12-13 at 14:04 -0800, Ivan Korjavin wrote: > I have a goroutenie with scanner.Scan > It looks like: > > ``` > cnn.SetReadDeadline(time.Now().Add(c.rTimeout)) // 10s > scanner := bufio.NewScanner(cnn) > for scanner.Scan() { > ... > } > ``` > cnn is a net.Conn there > > My problem is when I call cnn.Close() (and I tried > cnn.SetReadDeadline(time.Now()) in addition as well) > this scanner.Scan is still running and running and running. > > I would like to close it immediately, but can't find a way how. > > > Please, help me! > -- 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.