aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/net/sock_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/sock_windows.go')
-rw-r--r--libgo/go/net/sock_windows.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/libgo/go/net/sock_windows.go b/libgo/go/net/sock_windows.go
index fc5d9e5..41368d3 100644
--- a/libgo/go/net/sock_windows.go
+++ b/libgo/go/net/sock_windows.go
@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Sockets for Windows
-
package net
import "syscall"
func maxListenerBacklog() int {
// TODO: Implement this
+ // NOTE: Never return a number bigger than 1<<16 - 1. See issue 5030.
return syscall.SOMAXCONN
}
@@ -18,25 +17,23 @@ func listenerSockaddr(s syscall.Handle, f int, la syscall.Sockaddr, toAddr func(
if a == nil {
return la, nil
}
- switch v := a.(type) {
+ switch a := a.(type) {
case *TCPAddr, *UnixAddr:
- err := setDefaultListenerSockopts(s)
- if err != nil {
+ if err := setDefaultListenerSockopts(s); err != nil {
return nil, err
}
case *UDPAddr:
- if v.IP.IsMulticast() {
- err := setDefaultMulticastSockopts(s)
- if err != nil {
+ if a.IP.IsMulticast() {
+ if err := setDefaultMulticastSockopts(s); err != nil {
return nil, err
}
switch f {
case syscall.AF_INET:
- v.IP = IPv4zero
+ a.IP = IPv4zero
case syscall.AF_INET6:
- v.IP = IPv6unspecified
+ a.IP = IPv6unspecified
}
- return v.sockaddr(f)
+ return a.sockaddr(f)
}
}
return la, nil