grpc: Index | Files

package bufconn

import ""

Package bufconn provides a net.Conn implemented by a buffer and related dialing and listening functionality.


Package Files


type Listener Uses

type Listener struct {
    // contains filtered or unexported fields

Listener implements a net.Listener that creates local, buffered net.Conns via its Accept and Dial method.

func Listen Uses

func Listen(sz int) *Listener

Listen returns a Listener that can only be contacted by its own Dialers and creates buffered connections between the two.

func (*Listener) Accept Uses

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

Accept blocks until Dial is called, then returns a net.Conn for the server half of the connection.

func (*Listener) Addr Uses

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

Addr reports the address of the listener.

func (*Listener) Close Uses

func (l *Listener) Close() error

Close stops the listener.

func (*Listener) Dial Uses

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

Dial creates an in-memory full-duplex network connection, unblocks Accept by providing it the server half of the connection, and returns the client half of the connection.

Package bufconn imports 5 packages (graph) and is imported by 31 packages. Updated 2019-11-19. Refresh now. Tools for package owners.