LEFT | RIGHT |
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 // Sockets for Windows | |
6 | |
7 package net | |
8 | |
9 import "syscall" | |
10 | |
11 func maxListenerBacklog() int { | |
12 // TODO: Implement this | 1 // TODO: Implement this |
13 return syscall.SOMAXCONN | 2 return syscall.SOMAXCONN |
14 } | 3 } |
15 | |
16 func multicastListenerSockaddr(s syscall.Handle, f int, la syscall.Sockaddr, toA
ddr func(syscall.Sockaddr) Addr) (syscall.Sockaddr, error) { | |
17 a := toAddr(la) | |
18 if a == nil { | |
19 return la, nil | |
20 } | |
21 switch v := a.(type) { | |
22 case *UDPAddr: | |
23 if v.IP.IsMulticast() { | |
24 setDefaultMulticastSockopts(s) | |
25 switch f { | |
26 case syscall.AF_INET: | |
27 v.IP = IPv4zero | |
28 case syscall.AF_INET6: | |
29 v.IP = IPv6unspecified | |
30 } | |
31 return v.sockaddr(f) | |
32 } | |
33 } | |
34 return la, nil | |
35 } | |
LEFT | RIGHT |