Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 24 for closeWrite (0.22 sec)

  1. src/net/tcpsock.go

    	}
    	return nil
    }
    
    // CloseWrite shuts down the writing side of the TCP connection.
    // Most callers should just use Close.
    func (c *TCPConn) CloseWrite() error {
    	if !c.ok() {
    		return syscall.EINVAL
    	}
    	if err := c.fd.closeWrite(); err != nil {
    		return &OpError{Op: "close", Net: c.fd.net, Source: c.fd.laddr, Addr: c.fd.raddr, Err: err}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 03:10:07 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  2. src/net/fd_posix.go

    	err := fd.pfd.Shutdown(how)
    	runtime.KeepAlive(fd)
    	return wrapSyscallError("shutdown", err)
    }
    
    func (fd *netFD) closeRead() error {
    	return fd.shutdown(syscall.SHUT_RD)
    }
    
    func (fd *netFD) closeWrite() error {
    	return fd.shutdown(syscall.SHUT_WR)
    }
    
    func (fd *netFD) Read(p []byte) (n int, err error) {
    	n, err = fd.pfd.Read(p)
    	runtime.KeepAlive(fd)
    	return n, wrapSyscallError(readSyscallName, err)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 4.3K bytes
    - Viewed (0)
  3. src/net/http/export_test.go

    	// if needed.
    	rstAvoidanceDelay = 1 * time.Nanosecond
    }
    
    // SetRSTAvoidanceDelay sets how long we are willing to wait between calling
    // CloseWrite on a connection and fully closing the connection.
    func SetRSTAvoidanceDelay(t *testing.T, d time.Duration) {
    	prevDelay := rstAvoidanceDelay
    	t.Cleanup(func() {
    		rstAvoidanceDelay = prevDelay
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:11:57 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  4. src/crypto/tls/conn.go

    	return alertErr
    }
    
    var errEarlyCloseWrite = errors.New("tls: CloseWrite called before handshake complete")
    
    // CloseWrite shuts down the writing side of the connection. It should only be
    // called once the handshake has completed and does not call CloseWrite on the
    // underlying connection. Most callers should just use [Conn.Close].
    func (c *Conn) CloseWrite() error {
    	if !c.isHandshakeComplete.Load() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 51.8K bytes
    - Viewed (0)
  5. src/net/error_test.go

    		for i := 0; i < 3; i++ {
    			err = c.(*TCPConn).CloseRead()
    			if perr := parseCloseError(err, true); perr != nil {
    				t.Errorf("#%d: %v", i, perr)
    			}
    		}
    		for i := 0; i < 3; i++ {
    			err = c.(*TCPConn).CloseWrite()
    			if perr := parseCloseError(err, true); perr != nil {
    				t.Errorf("#%d: %v", i, perr)
    			}
    		}
    		for i := 0; i < 3; i++ {
    			err = c.Close()
    			if perr := parseCloseError(err, false); perr != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 20.3K bytes
    - Viewed (0)
  6. src/net/rpc/server_test.go

    	// If the code is correct, this test will never fail, regardless of timeout.
    	args.A = 10 // 10 ms
    	done := make(chan *Call, 1)
    	call := client.Go("Arith.SleepMilli", args, reply, done)
    	c.(*net.TCPConn).CloseWrite()
    	<-done
    	if call.Error != nil {
    		t.Fatal(err)
    	}
    }
    
    func benchmarkEndToEnd(dial func() (*Client, error), b *testing.B) {
    	once.Do(startServer)
    	client, err := dial()
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 18 05:23:29 UTC 2023
    - 19K bytes
    - Viewed (0)
  7. src/net/http/serve_test.go

    	conn, err := net.Dial("tcp", ts.Listener.Addr().String())
    	if err != nil {
    		t.Fatalf("Dial: %v", err)
    	}
    	err = conn.(*net.TCPConn).CloseWrite()
    	if err != nil {
    		t.Fatalf("CloseWrite: %v", err)
    	}
    
    	bs, err := io.ReadAll(conn)
    	if err != nil {
    		t.Errorf("ReadAll: %v", err)
    	}
    	got := string(bs)
    	if got != "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
  8. src/net/http/server.go

    //
    // TODO(bcmills): This should arguably be a server configuration parameter,
    // not a hard-coded value.
    var rstAvoidanceDelay = 500 * time.Millisecond
    
    type closeWriter interface {
    	CloseWrite() error
    }
    
    var _ closeWriter = (*net.TCPConn)(nil)
    
    // closeWriteAndWait flushes any outstanding data and sends a FIN packet (if
    // client is connected via TCP), signaling that we're done. We then
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 123.4K bytes
    - Viewed (0)
  9. internal/ringbuffer/README.md

    `TryRead` and `TryWrite` are still available for non-blocking reads and writes.
    
    To signify the end of the stream, close the ring buffer from the writer side with `rb.CloseWriter()`
    
    Either side can use `rb.CloseWithError(err error)` to signal an error and close the ring buffer. 
    Any reads or writes will return the error on next call.
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 15 00:11:04 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(*Config).Clone", Method, 8},
    		{"(*Config).DecryptTicket", Method, 21},
    		{"(*Config).EncryptTicket", Method, 21},
    		{"(*Config).SetSessionTicketKeys", Method, 5},
    		{"(*Conn).Close", Method, 0},
    		{"(*Conn).CloseWrite", Method, 8},
    		{"(*Conn).ConnectionState", Method, 0},
    		{"(*Conn).Handshake", Method, 0},
    		{"(*Conn).HandshakeContext", Method, 17},
    		{"(*Conn).LocalAddr", Method, 0},
    		{"(*Conn).NetConn", Method, 18},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top