inprocess

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package inprocess implements in-process network connections and corresponding dialing/listening.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pipe

func Pipe() (net.Conn, net.Conn)

Pipe creates a synchronous, in-memory, full duplex network connection; both ends implement the Conn interface. Reads on one end are matched with writes on the other, copying data directly between the two; there is no internal buffering.

Types

type Listener

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

Listener is the inprocess network listener

func Listen

func Listen() *Listener

Listen creates an in-process listener

func (*Listener) Accept

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

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

func (*Listener) Addr

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

Addr returns the listener's network address.

func (*Listener) Close

func (r *Listener) Close() error

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

func (*Listener) Dial

func (r *Listener) Dial() (net.Conn, error)

Dial creates a connection to this listener

type ListenerInterface

type ListenerInterface interface {
	net.Listener
	// Dial creates a new inprocess connection
	Dial() (net.Conn, error)
}

ListenerInterface is the inprocess listener

Jump to

Keyboard shortcuts

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