Skip to content

Bundle multiple Golang net.Listeners into a single one.

License

Notifications You must be signed in to change notification settings

TheCount/go-multilisten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multilisten

Documentation

multilisten is a Go package for bundling multiple net.Listeners into a single one.

This package is useful when a third-party package expects a single net.Listener to build some service, but you would actually like to listen on several endpoints (ports, specific interfaces, files).

Install

go get github.com/TheCount/go-multilisten/multilisten

Usage

For the detailed API, see the Documentation.

Essentially, all you have to do is bundle your listeners like this:

bundle, err := multilisten.Bundle(l1, l2, l3)

and then use bundle like a single listener. It will accept from l1, l2 and l3 simultaneously.

About

Bundle multiple Golang net.Listeners into a single one.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages