INNER CODE UNIT · Go

func

yahoo/vssh · client.go:408

func (r *Response) setTimeout(t time.Duration) {
	r.toCancel = make(chan struct{})

	go func() {
		select {
		case <-r.toCancel:
			return
		case <-time.After(t):
			r.err = TimeoutError{errTimeout}
			r.session.Close()
		}
	}()
}

func (r *Response) cancelTimeout() {
	close(r.toCancel)
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…