netconnlimit

package
v0.300.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package netconnlimit provides network utility functions for limiting simultaneous connections across multiple listeners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSharedSemaphore

func NewSharedSemaphore(n int) chan struct{}

NewSharedSemaphore creates and returns a new semaphore channel that can be used to limit the number of simultaneous connections across multiple listeners.

func SharedLimitListener

func SharedLimitListener(l net.Listener, sem chan struct{}) net.Listener

SharedLimitListener returns a listener that accepts at most n simultaneous connections across multiple listeners using the provided shared semaphore.

Types

This section is empty.

Jump to

Keyboard shortcuts

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