LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 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 darwin dragonfly freebsd nacl netbsd openbsd | 5 // +build darwin dragonfly freebsd netbsd openbsd |
6 | 6 |
7 package net | 7 package net |
8 | 8 |
9 import ( | 9 import ( |
10 "runtime" | 10 "runtime" |
11 "syscall" | 11 "syscall" |
12 ) | 12 ) |
13 | 13 |
14 func maxListenerBacklog() int { | 14 func maxListenerBacklog() int { |
15 var ( | 15 var ( |
(...skipping 12 matching lines...) Expand all Loading... |
28 return syscall.SOMAXCONN | 28 return syscall.SOMAXCONN |
29 } | 29 } |
30 // FreeBSD stores the backlog in a uint16, as does Linux. | 30 // FreeBSD stores the backlog in a uint16, as does Linux. |
31 // Assume the other BSDs do too. Truncate number to avoid wrapping. | 31 // Assume the other BSDs do too. Truncate number to avoid wrapping. |
32 // See issue 5030. | 32 // See issue 5030. |
33 if n > 1<<16-1 { | 33 if n > 1<<16-1 { |
34 n = 1<<16 - 1 | 34 n = 1<<16 - 1 |
35 } | 35 } |
36 return int(n) | 36 return int(n) |
37 } | 37 } |
LEFT | RIGHT |