Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for closeNotify (3.6 sec)

  1. src/crypto/tls/conn.go

    		// waiting on handshakeMutex or the c.out mutex.
    		return c.conn.Close()
    	}
    
    	var alertErr error
    	if c.isHandshakeComplete.Load() {
    		if err := c.closeNotify(); err != nil {
    			alertErr = fmt.Errorf("tls: failed to send closeNotify alert (but connection was closed anyway): %w", err)
    		}
    	}
    
    	if err := c.conn.Close(); err != nil {
    		return err
    	}
    	return alertErr
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 51.8K bytes
    - Viewed (0)
  2. src/net/http/server.go

    // New code should use [Request.Context] instead.
    type CloseNotifier interface {
    	// CloseNotify returns a channel that receives at most a
    	// single value (true) when the client connection has gone
    	// away.
    	//
    	// CloseNotify may wait to notify until Request.Body has been
    	// fully read.
    	//
    	// After the Handler has returned, there is no guarantee
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 123.4K bytes
    - Viewed (0)
  3. src/net/http/httputil/reverseproxy_test.go

    		select {
    		case <-time.After(10 * time.Second):
    			// Note: this should only happen in broken implementations, and the
    			// closenotify case should be instantaneous.
    			t.Error("Handler never saw CloseNotify")
    			return
    		case <-w.(http.CloseNotifier).CloseNotify():
    		}
    
    		w.WriteHeader(http.StatusOK)
    		w.Write([]byte(backendResponse))
    	}))
    
    	defer backend.Close()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 54.6K bytes
    - Viewed (0)
  4. src/net/http/serve_test.go

    	script := make(chan string, 2)
    	script <- "closenotify"
    	script <- "hijack"
    	close(script)
    	ts := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
    		plan := <-script
    		switch plan {
    		default:
    			panic("bogus plan; too many requests")
    		case "closenotify":
    			w.(CloseNotifier).CloseNotify() // discard result
    			w.Header().Set("X-Addr", r.RemoteAddr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
  5. src/net/http/h2_bundle.go

    			select {
    			case <-rws.stream.cw:
    				err = rws.stream.closeErr
    			default:
    			}
    		}
    	}
    	return err
    }
    
    func (w *http2responseWriter) CloseNotify() <-chan bool {
    	rws := w.rws
    	if rws == nil {
    		panic("CloseNotify called after Handler finished")
    	}
    	rws.closeNotifierMu.Lock()
    	ch := rws.closeNotifierCh
    	if ch == nil {
    		ch = make(chan bool, 1)
    		rws.closeNotifierCh = ch
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 364.1K bytes
    - Viewed (0)
Back to top