inproc

package
v0.10.1-0...-604833f Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package inproc provides tools to implement an in-process asynchronous pipe of net.Conns.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed      = xerrors.New("inproc: connection closed")
	ErrConnRefused = xerrors.New("inproc: connection refused")
)

Functions

func Dial

func Dial(addr string) (net.Conn, error)

Dial connects to the given address.

Types

type Addr

type Addr string

Addr represents an in-process "network" end-point address.

func (Addr) Network

func (a Addr) Network() string

Network returns the name of the network.

func (Addr) String

func (a Addr) String() string

String implements net.Addr.String

type Listener

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

A Listener is an in-process listener for stream-oriented protocols. Listener implements net.Listener.

Multiple goroutines may invoke methods on a Listener simultaneously.

func Listen

func Listen(addr string) (*Listener, error)

Listen announces on the given address.

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept waits for and returns the next connection to the listener.

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

Addr returns the listener's netword address.

func (*Listener) Close

func (l *Listener) Close() error

Close closes the listener. Any blocked Accept operations will be unblocked and return errors.

Jump to

Keyboard shortcuts

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