Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for closeFunc (0.15 sec)

  1. src/net/sock_cloexec_solaris.go

    	if err == nil {
    		syscall.CloseOnExec(s)
    	}
    	syscall.ForkLock.RUnlock()
    	if err != nil {
    		return -1, os.NewSyscallError("socket", err)
    	}
    	if err = syscall.SetNonblock(s, true); err != nil {
    		poll.CloseFunc(s)
    		return -1, os.NewSyscallError("setnonblock", err)
    	}
    	return s, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:17:25 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  2. src/internal/poll/sock_cloexec_solaris.go

    	ns, sa, err := AcceptFunc(s)
    	if err == nil {
    		syscall.CloseOnExec(ns)
    	}
    	if err != nil {
    		return -1, nil, "accept", err
    	}
    	if err = syscall.SetNonblock(ns, true); err != nil {
    		CloseFunc(ns)
    		return -1, nil, "setnonblock", err
    	}
    	return ns, sa, "", nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:17:25 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  3. src/net/ipsock_posix.go

    		p.ipv4MappedIPv6Enabled = true
    		return
    	}
    
    	s, err := sysSocket(syscall.AF_INET, syscall.SOCK_STREAM, syscall.IPPROTO_TCP)
    	switch err {
    	case syscall.EAFNOSUPPORT, syscall.EPROTONOSUPPORT:
    	case nil:
    		poll.CloseFunc(s)
    		p.ipv4Enabled = true
    	}
    	var probes = []struct {
    		laddr TCPAddr
    		value int
    	}{
    		// IPv6 communication capability
    		{laddr: TCPAddr{IP: ParseIP("::1")}, value: 1},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  4. src/internal/poll/fd_wasip1.go

    	// If the descriptor is indeed closed, using a loop would race
    	// with some other goroutine opening a new descriptor.
    	// (The Linux kernel guarantees that it is closed on an EINTR error.)
    	return CloseFunc(fd)
    }
    
    // Copy creates a copy of the FD.
    //
    // The FD instance points to the same underlying file descriptor. The file
    // descriptor isn't closed until all FD instances that refer to it have been
    // closed/destroyed.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 20:14:02 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  5. src/crypto/tls/tls_test.go

    type changeImplConn struct {
    	net.Conn
    	writeFunc func([]byte) (int, error)
    	closeFunc func() error
    }
    
    func (w *changeImplConn) Write(p []byte) (n int, err error) {
    	if w.writeFunc != nil {
    		return w.writeFunc(p)
    	}
    	return w.Conn.Write(p)
    }
    
    func (w *changeImplConn) Close() error {
    	if w.closeFunc != nil {
    		return w.closeFunc()
    	}
    	return w.Conn.Close()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 60.5K bytes
    - Viewed (0)
  6. src/internal/poll/fd_unix.go

    // no remaining references.
    func (fd *FD) destroy() error {
    	// Poller may want to unregister fd in readiness notification mechanism,
    	// so this must be executed before CloseFunc.
    	fd.pd.close()
    
    	err := fd.SysFile.destroy(fd.Sysfd)
    
    	fd.Sysfd = -1
    	runtime_Semrelease(&fd.csema)
    	return err
    }
    
    // Close closes the FD. The underlying file descriptor is closed by the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 04:09:44 UTC 2024
    - 17.9K bytes
    - Viewed (0)
  7. src/net/http/clientserver_test.go

    	cst.tr.CloseIdleConnections()
    	a2 := get()
    	if a1 == a2 {
    		t.Errorf("didn't close connection")
    	}
    }
    
    type noteCloseConn struct {
    	net.Conn
    	closeFunc func()
    }
    
    func (x noteCloseConn) Close() error {
    	x.closeFunc()
    	return x.Conn.Close()
    }
    
    type testErrorReader struct{ t *testing.T }
    
    func (r testErrorReader) Read(p []byte) (n int, err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 46.6K bytes
    - Viewed (0)
  8. src/net/http/serve_test.go

    type rwTestConn struct {
    	io.Reader
    	io.Writer
    	noopConn
    
    	closeFunc func() error // called if non-nil
    	closec    chan bool    // else, if non-nil, send value to it on close
    }
    
    func (c *rwTestConn) Close() error {
    	if c.closeFunc != nil {
    		return c.closeFunc()
    	}
    	select {
    	case c.closec <- true:
    	default:
    	}
    	return nil
    }
    
    type testConn struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
  9. src/net/http/transport_test.go

    	// leaked goroutines.
    	if got, want := res.Header.Get("Foo"), "Bar"; got != want {
    		t.Errorf("Foo header = %q; want %q", got, want)
    	}
    }
    
    type closerFunc func() error
    
    func (f closerFunc) Close() error { return f() }
    
    type writerFuncConn struct {
    	net.Conn
    	write func(p []byte) (n int, err error)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 192.6K bytes
    - Viewed (0)
Back to top