cmux

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

The cmux package creates a multiplexer over connections. The point is to register accept/protocol handlers that can consume a few bytes of their traffic to determine if a connection matches their protocol. If so, handle it, otherwise move onto the next

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchAll

func MatchAll([]byte) bool

Types

type CMux

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

func NewCMux

func NewCMux(listener net.Listener) CMux

func (*CMux) Addr

func (c *CMux) Addr() net.Addr

func (*CMux) Close

func (c *CMux) Close() error

func (*CMux) RegisterProtocol

func (c *CMux) RegisterProtocol(match ProtocolMatcher) (net.Listener, error)

func (*CMux) Start

func (c *CMux) Start() error

type ProtocolMatcher

type ProtocolMatcher func([]byte) bool

Jump to

Keyboard shortcuts

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