mux

package
v0.0.0-...-b359386 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mux provides a multiplexer for net.Listener.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mux

type Mux struct {
	Timeout   time.Duration
	LogOutput io.Writer
	// contains filtered or unexported fields
}

Mux represents a multiplexer for a net.Listener.

func New

func New(ln net.Listener) *Mux

New returns a new instance of Mux.

func (*Mux) Close

func (mux *Mux) Close() (err error)

Close closes the underlying listener.

func (*Mux) Listen

func (mux *Mux) Listen(hdrs []byte) net.Listener

Listen returns a listener that receives connections from any byte in hdrs. Re-registering hdr bytes will overwrite existing handlers.

func (*Mux) Serve

func (mux *Mux) Serve() error

Serve handles connections from ln and multiplexes then across registered listener.

Jump to

Keyboard shortcuts

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