internal

package
v0.0.0-...-f3e0859 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PacketConnPool

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

PacketConnPool caches multiple packet connections in a least-recently-used cache. In addition any connection added to the pool is also being read for incoming packets.

func NewPacketConnPool

func NewPacketConnPool(
	packetCh chan<- *memberlist.Packet,
	reg prometheus.Registerer,
	log *log.Logger,
	localAddr string,
) *PacketConnPool

NewPacketConnPool instantiates a new packet connection pool.

func (*PacketConnPool) AddAndRead

func (p *PacketConnPool) AddAndRead(remoteAddr string, conn net.Conn, incoming bool) error

AddAndRead adds a connection to the pool and start reading for incoming packages.

func (*PacketConnPool) Get

func (p *PacketConnPool) Get(addr string) (net.Conn, bool)

Get returns a connection to the given address or returns false.

func (*PacketConnPool) Shutdown

func (p *PacketConnPool) Shutdown()

Shutdown closes and removes all connections from the pool.

Jump to

Keyboard shortcuts

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