Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for closeFunc (0.3 sec)

  1. src/net/file_unix.go

    		poll.CloseFunc(s)
    		return -1, os.NewSyscallError("setnonblock", err)
    	}
    	return s, nil
    }
    
    func newFileFD(f *os.File) (*netFD, error) {
    	s, err := dupSocket(f)
    	if err != nil {
    		return nil, err
    	}
    	family := syscall.AF_UNSPEC
    	sotype, err := syscall.GetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_TYPE)
    	if err != nil {
    		poll.CloseFunc(s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 06:04:31 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  2. src/net/main_windows_test.go

    	// Placeholders for saving original socket system calls.
    	origWSASocket   = wsaSocketFunc
    	origClosesocket = poll.CloseFunc
    	origConnect     = connectFunc
    	origConnectEx   = poll.ConnectExFunc
    	origListen      = listenFunc
    	origAccept      = poll.AcceptFunc
    )
    
    func installTestHooks() {
    	wsaSocketFunc = sw.WSASocket
    	poll.CloseFunc = sw.Closesocket
    	connectFunc = sw.Connect
    	poll.ConnectExFunc = sw.ConnectEx
    	listenFunc = sw.Listen
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 18:36:30 UTC 2023
    - 1K bytes
    - Viewed (0)
  3. src/internal/poll/splice_linux_test.go

    	"sync/atomic"
    	"testing"
    	"time"
    )
    
    var closeHook atomic.Value // func(fd int)
    
    func init() {
    	closeFunc := poll.CloseFunc
    	poll.CloseFunc = func(fd int) (err error) {
    		if v := closeHook.Load(); v != nil {
    			if hook := v.(func(int)); hook != nil {
    				hook(fd)
    			}
    		}
    		return closeFunc(fd)
    	}
    }
    
    func TestSplicePipePool(t *testing.T) {
    	const N = 64
    	var (
    		p          *poll.SplicePipe
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:49:26 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  4. src/net/internal/socktest/main_test.go

    	"os"
    	"sync"
    	"syscall"
    	"testing"
    )
    
    var sw socktest.Switch
    
    func TestMain(m *testing.M) {
    	installTestHooks()
    
    	st := m.Run()
    
    	for s := range sw.Sockets() {
    		closeFunc(s)
    	}
    	uninstallTestHooks()
    	os.Exit(st)
    }
    
    func TestSwitch(t *testing.T) {
    	const N = 10
    	var wg sync.WaitGroup
    	wg.Add(N)
    	for i := 0; i < N; i++ {
    		go func() {
    			defer wg.Done()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 18:36:30 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. src/net/sock_posix.go

    	s, err := sysSocket(family, sotype, proto)
    	if err != nil {
    		return nil, err
    	}
    	if err = setDefaultSockopts(s, family, sotype, ipv6only); err != nil {
    		poll.CloseFunc(s)
    		return nil, err
    	}
    	if fd, err = newFD(s, family, sotype, net); err != nil {
    		poll.CloseFunc(s)
    		return nil, err
    	}
    
    	// This function makes a network file descriptor for the
    	// following applications:
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.go

    		c.forget(graceful)
    	}
    
    	if timer == nil {
    		closeFunc()
    		return false
    	}
    
    	// OK, block sending, but only until timer fires.
    	select {
    	case c.input <- event:
    		return true
    	case <-timer.C:
    		closeFunc()
    		return false
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 12:22:41 UTC 2023
    - 18.7K bytes
    - Viewed (0)
  9. src/internal/poll/splice_linux.go

    	return &splicePipe{splicePipeFields: splicePipeFields{rfd: fds[0], wfd: fds[1]}}
    }
    
    // destroyPipe destroys a pipe.
    func destroyPipe(p *splicePipe) {
    	CloseFunc(p.rfd)
    	CloseFunc(p.wfd)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:49:26 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  10. 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)
Back to top