Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3389)

Side by Side Diff: src/net/sockopt_stub.go

Issue 143830044: code review 143830044: net: separate NaCl dependent placeholders from BSD's (Closed)
Patch Set: diff -r cb1c0e8fc75d3e7706412701b765143880ea0196 https://go.googlecode.com/hg/ Created 10 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/net/sockopt_posix.go ('k') | src/net/sockoptip_bsd.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build nacl
6
5 package net 7 package net
6 8
7 import ( 9 import "syscall"
8 » "os"
9 » "syscall"
10 )
11 10
12 func setDefaultSockopts(s, family, sotype int, ipv6only bool) error { 11 func setDefaultSockopts(s, family, sotype int, ipv6only bool) error {
13 » if family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW { 12 » return nil
14 » » // Allow both IP versions even if the OS default
15 » » // is otherwise. Note that some operating systems
16 » » // never admit this option.
17 » » syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ON LY, boolint(ipv6only))
18 » }
19 » // Allow broadcast.
20 » return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(s, syscall .SOL_SOCKET, syscall.SO_BROADCAST, 1))
21 } 13 }
22 14
23 func setDefaultListenerSockopts(s int) error { 15 func setDefaultListenerSockopts(s int) error {
24 » // Allow reuse of recently-used addresses. 16 » return nil
25 » return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(s, syscall .SOL_SOCKET, syscall.SO_REUSEADDR, 1))
26 } 17 }
27 18
28 func setDefaultMulticastSockopts(s int) error { 19 func setDefaultMulticastSockopts(s int) error {
29 » // Allow multicast UDP and raw IP datagram sockets to listen 20 » return nil
30 » // concurrently across multiple listeners.
31 » return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(s, syscall .SOL_SOCKET, syscall.SO_REUSEADDR, 1))
32 } 21 }
22
23 func setReadBuffer(fd *netFD, bytes int) error {
24 return syscall.ENOPROTOOPT
25 }
26
27 func setWriteBuffer(fd *netFD, bytes int) error {
28 return syscall.ENOPROTOOPT
29 }
30
31 func setKeepAlive(fd *netFD, keepalive bool) error {
32 return syscall.ENOPROTOOPT
33 }
34
35 func setLinger(fd *netFD, sec int) error {
36 return syscall.ENOPROTOOPT
37 }
OLDNEW
« no previous file with comments | « src/net/sockopt_posix.go ('k') | src/net/sockoptip_bsd.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b