ipld-eth-server/vendor/github.com/libp2p/go-reuseport-transport
2019-12-02 13:24:49 -06:00
..
.travis.yml update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
codecov.yml update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
dial.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
go.mod update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
go.sum update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
LICENSE update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
listen.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
Makefile update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
multidialer.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
package.json update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
README.md update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
reuseport.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
singledialer.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
transport.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00

go-reuseport-transport

standard-readme compliant GoDoc Coverage Status Build Status

Basic reuseport TCP transport

This package provides a basic transport for automatically (and intelligently) reusing TCP ports.

To use, construct a new Transport (the zero value is safe to use) and configure any listeners (tr.Listen(...)).

Then, when dialing (tr.Dial(...)), the transport will attempt to reuse the ports it's currently listening on, choosing the best one depending on the destination address.

NOTE: Currently, we don't make any attempts to prevent two reusport transports from interfering with each other (reusing each other's ports). However, we reserve the right to fix this in the future.

Install

go-reuseport-transport is a standard Go module which can be installed with:

go get github.com/libp2p/go-reuseport-transport

Note that go-reuseport-transport is packaged with Gx, so it is recommended to use Gx to install and use it (see the Usage section).

Usage

This module is packaged with Gx. In order to use it in your own project it is recommended that you:

go get -u github.com/whyrusleeping/gx
go get -u github.com/whyrusleeping/gx-go
cd <your-project-repository>
gx init
gx import github.com/libp2p/go-reuseport-transport
gx install --global
gx-go --rewrite

Please check Gx and Gx-go documentation for more information.

This package is currently used by the go-tcp-transport libp2p transport and will likely be used by more libp2p transports in the future.

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

Want to hack on IPFS?

License

MIT