dialer

package
v0.0.0-...-155060c Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2017 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package dialer provides a Dialer interface and implementation which provide a mechanism to reused net.Conn connections.

The semantics around reuse of a Dialer provided Conn are defined by the consumer of the connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	net.Conn

	// Release returns the connection to the Dialer without closing it.
	// Callers must only call Release when it is known that the previous
	// request on the Conn has been fully consumed.
	Release()
}

Conn extends the net.Conn interface with a method of making connections available for reuse, Release.

type Dialer

type Dialer interface {

	// Dial connects to the address on the named network.
	// Implementations may return an existing Conn if one is available.
	// Multiple calls to Dial may block if the implementations define
	// global or per remote connection limits.
	Dial(network, addr string) (Conn, error)

	// Shutdown shuts down the Dialer.
	Shutdown()
}

Dialer represents a type which can Dial a remote network server. Dialer implementations may return existing connections if safe to do so.

func New

func New() Dialer

New returns a Dialer implementation.

Jump to

Keyboard shortcuts

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