netutil

package
v1.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SharedLimitListener

func SharedLimitListener(listener net.Listener, limiter *Limiter) net.Listener

SharedLimitListener returns a Listener that accepts simultaneous connections from the provided Listener only if a shared availability pool permits it. Based on https://godoc.org/golang.org/x/net/netutil

Types

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

Limiter is used to provide a shared pool of connection slots. Use NewLimiter to create an instance

func NewLimiter

func NewLimiter(n int) *Limiter

NewLimiter creates a Limiter with the given capacity

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL