Source file
src/net/sock_windows.go
1
2
3
4
5 package net
6
7 import (
8 "internal/syscall/windows"
9 "os"
10 "syscall"
11 )
12
13 func maxListenerBacklog() int {
14
15
16 return syscall.SOMAXCONN
17 }
18
19 func sysSocket(family, sotype, proto int) (syscall.Handle, error) {
20 s, err := wsaSocketFunc(int32(family), int32(sotype), int32(proto),
21 nil, 0, windows.WSA_FLAG_OVERLAPPED|windows.WSA_FLAG_NO_HANDLE_INHERIT)
22 if err == nil {
23 return s, nil
24 }
25
26
27
28
29
30
31 syscall.ForkLock.RLock()
32 s, err = socketFunc(family, sotype, proto)
33 if err == nil {
34 syscall.CloseOnExec(s)
35 }
36 syscall.ForkLock.RUnlock()
37 if err != nil {
38 return syscall.InvalidHandle, os.NewSyscallError("socket", err)
39 }
40 return s, nil
41 }
42
View as plain text