OSDN Git Service

libgo: update to weekly.2011-10-25
[pf3gnuchains/gcc-fork.git] / libgo / go / net / sock_windows.go
1 // Copyright 2011 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 (
10         "syscall"
11 )
12
13 func setKernelSpecificSockopt(s syscall.Handle, f int) {
14         // Allow broadcast.
15         syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
16
17         if f == syscall.AF_INET6 {
18                 // using ip, tcp, udp, etc.
19                 // allow both protocols even if the OS default is otherwise.
20                 syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, 0)
21         }
22 }