Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 296 for sotype (0.14 sec)

  1. src/net/sys_cloexec.go

    // descriptor as nonblocking and close-on-exec.
    func sysSocket(family, sotype, proto int) (int, error) {
    	// See ../syscall/exec_unix.go for description of ForkLock.
    	syscall.ForkLock.RLock()
    	s, err := socketFunc(family, sotype, proto)
    	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 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 03 14:38:32 UTC 2022
    - 962 bytes
    - Viewed (0)
  2. src/net/sock_windows.go

    	return syscall.SOMAXCONN
    }
    
    func sysSocket(family, sotype, proto int) (syscall.Handle, error) {
    	s, err := wsaSocketFunc(int32(family), int32(sotype), int32(proto),
    		nil, 0, windows.WSA_FLAG_OVERLAPPED|windows.WSA_FLAG_NO_HANDLE_INHERIT)
    	if err != nil {
    		return syscall.InvalidHandle, os.NewSyscallError("socket", err)
    	}
    	return s, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 08 18:52:56 UTC 2024
    - 802 bytes
    - Viewed (0)
  3. src/net/sock_cloexec_solaris.go

    )
    
    // Wrapper around the socket system call that marks the returned file
    // descriptor as nonblocking and close-on-exec.
    func sysSocket(family, sotype, proto int) (int, error) {
    	// Perform a cheap test and try the fast path first.
    	if unix.SupportSockNonblockCloexec() {
    		s, err := socketFunc(family, sotype|syscall.SOCK_NONBLOCK|syscall.SOCK_CLOEXEC, proto)
    		if err != nil {
    			return -1, os.NewSyscallError("socket", 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)
  4. src/net/internal/socktest/switch_windows.go

    	return &so
    }
    
    // addLocked returns a new Status without locking.
    // sw.smu must be held before call.
    func (sw *Switch) addLocked(s syscall.Handle, family, sotype, proto int) *Status {
    	sw.once.Do(sw.init)
    	so := Status{Cookie: cookie(family, sotype, proto)}
    	sw.sotab[s] = so
    	return &so
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 13 21:38:34 UTC 2015
    - 730 bytes
    - Viewed (0)
  5. src/net/sockaddr_posix.go

    	switch fd.family {
    	case syscall.AF_INET, syscall.AF_INET6:
    		switch fd.sotype {
    		case syscall.SOCK_STREAM:
    			return sockaddrToTCP
    		case syscall.SOCK_DGRAM:
    			return sockaddrToUDP
    		case syscall.SOCK_RAW:
    			return sockaddrToIP
    		}
    	case syscall.AF_UNIX:
    		switch fd.sotype {
    		case syscall.SOCK_STREAM:
    			return sockaddrToUnix
    		case syscall.SOCK_DGRAM:
    			return sockaddrToUnixgram
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  6. src/net/internal/socktest/sys_unix.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build unix || (js && wasm) || wasip1
    
    package socktest
    
    import "syscall"
    
    // Socket wraps [syscall.Socket].
    func (sw *Switch) Socket(family, sotype, proto int) (s int, err error) {
    	sw.once.Do(sw.init)
    
    	so := &Status{Cookie: cookie(family, sotype, proto)}
    	sw.fmu.RLock()
    	f := sw.fltab[FilterSocket]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 4K bytes
    - Viewed (0)
  7. src/net/internal/socktest/switch_unix.go

    	}
    	return &so
    }
    
    // addLocked returns a new Status without locking.
    // sw.smu must be held before call.
    func (sw *Switch) addLocked(s, family, sotype, proto int) *Status {
    	sw.once.Do(sw.init)
    	so := Status{Cookie: cookie(family, sotype, proto)}
    	sw.sotab[s] = so
    	return &so
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:54:10 UTC 2023
    - 718 bytes
    - Viewed (0)
  8. src/net/file_unix.go

    	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)
    		return nil, os.NewSyscallError("getsockopt", err)
    	}
    	lsa, _ := syscall.Getsockname(s)
    	rsa, _ := syscall.Getpeername(s)
    	switch lsa.(type) {
    	case *syscall.SockaddrInet4:
    		family = syscall.AF_INET
    	case *syscall.SockaddrInet6:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 06:04:31 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  9. 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
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  10. src/net/internal/socktest/sys_windows.go

    	sw.fmu.RLock()
    	f, _ := sw.fltab[FilterSocket]
    	sw.fmu.RUnlock()
    
    	af, err := f.apply(so)
    	if err != nil {
    		return syscall.InvalidHandle, err
    	}
    	s, so.Err = windows.WSASocket(family, sotype, proto, protinfo, group, flags)
    	if err = af.apply(so); err != nil {
    		if so.Err == nil {
    			syscall.Closesocket(s)
    		}
    		return syscall.InvalidHandle, err
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 4.3K bytes
    - Viewed (0)
Back to top