github.com/roboticscm/goman@v0.0.0-20210203095141-87c07b4a0a55/src/net/sock_windows.go (about) 1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package net 6 7 import "syscall" 8 9 func maxListenerBacklog() int { 10 // TODO: Implement this 11 // NOTE: Never return a number bigger than 1<<16 - 1. See issue 5030. 12 return syscall.SOMAXCONN 13 } 14 15 func sysSocket(f, t, p int) (syscall.Handle, error) { 16 // See ../syscall/exec_unix.go for description of ForkLock. 17 syscall.ForkLock.RLock() 18 s, err := syscall.Socket(f, t, p) 19 if err == nil { 20 syscall.CloseOnExec(s) 21 } 22 syscall.ForkLock.RUnlock() 23 return s, err 24 }