Help us shape the future of Go! Take the 2026 Go Developer Survey

netlimit

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT-0 Imports: 2 Imported by: 0

Documentation

Overview

Package netlimit bounds the number of accepted network connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

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

Limiter caps concurrent connections across one or more listeners. A zero or negative limit disables limiting.

func New

func New(max int) *Limiter

New returns a limiter for max concurrent connections.

func (*Limiter) Close

func (l *Limiter) Close()

Close unblocks listeners waiting for a connection slot.

func (*Limiter) Wrap

func (l *Limiter) Wrap(ln net.Listener) net.Listener

Wrap returns a listener that acquires a slot before Accept and releases it when the returned connection closes.

Jump to

Keyboard shortcuts

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