inproc

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: BSD-3-Clause Imports: 9 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      = errors.New("inproc: connection closed")
	ErrConnRefused = errors.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.

type Transport

type Transport struct{}

Transport implements the zmq4 Transport interface for the inproc transport.

func (Transport) Addr

func (Transport) Addr(ep string) (addr string, err error)

Addr returns the end-point address.

func (Transport) Dial

func (Transport) Dial(ctx context.Context, dialer transport.Dialer, addr string) (net.Conn, error)

Dial connects to the address on the named network using the provided context.

func (Transport) Listen

func (Transport) Listen(ctx context.Context, addr string) (net.Listener, error)

Listen announces on the provided network address.

Jump to

Keyboard shortcuts

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