mirror of https://github.com/golang/go.git
net: consolidate listenerBacklog declaration
Also adds maxListenerBacklog placeholder for Plan 9. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/11674044
This commit is contained in:
parent
dba623b1c7
commit
a0a45bbb71
|
|
@ -12,9 +12,6 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
// /sys/include/ape/sys/socket.h:/SOMAXCONN
|
||||
var listenerBacklog = 5
|
||||
|
||||
// probeIPv6Stack returns two boolean values. If the first boolean
|
||||
// value is true, kernel supports basic IPv6 functionality. If the
|
||||
// second boolean value is true, kernel supports IPv6 IPv4-mapping.
|
||||
|
|
|
|||
|
|
@ -259,6 +259,8 @@ type PacketConn interface {
|
|||
SetWriteDeadline(t time.Time) error
|
||||
}
|
||||
|
||||
var listenerBacklog = maxListenerBacklog()
|
||||
|
||||
// A Listener is a generic network listener for stream-oriented protocols.
|
||||
//
|
||||
// Multiple goroutines may invoke methods on a Listener simultaneously.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package net
|
||||
|
||||
func maxListenerBacklog() int {
|
||||
// /sys/include/ape/sys/socket.h:/SOMAXCONN
|
||||
return 5
|
||||
}
|
||||
|
|
@ -11,8 +11,6 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var listenerBacklog = maxListenerBacklog()
|
||||
|
||||
// Generic POSIX socket creation.
|
||||
func socket(net string, f, t, p int, ipv6only bool, ulsa, ursa syscall.Sockaddr, deadline time.Time, toAddr func(syscall.Sockaddr) Addr) (fd *netFD, err error) {
|
||||
s, err := sysSocket(f, t, p)
|
||||
|
|
|
|||
Loading…
Reference in New Issue