multiproto

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

package multiproto allows multiple protocols to be interpreted on a single socket, by receiving a small segment of bytes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedConn

type BufferedConn struct {
	net.Conn

	Reader *bufio.Reader
}

func NewBufferedConn

func NewBufferedConn(c net.Conn) *BufferedConn

func (*BufferedConn) Peek

func (bc *BufferedConn) Peek(n int) ([]byte, error)

func (*BufferedConn) Read

func (bc *BufferedConn) Read(p []byte) (int, error)

type Listener

type Listener struct {
	Fallback      bool
	ProtocolHello []byte
	// contains filtered or unexported fields
}

func (*Listener) Accept

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

func (*Listener) Addr

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

func (*Listener) Close

func (l *Listener) Close() error

type Router

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

func NewRouter

func NewRouter(address string) (r *Router, err error)

func (*Router) Close

func (r *Router) Close() error

func (*Router) FallbackListener

func (r *Router) FallbackListener() *Listener

func (*Router) SelectListener

func (r *Router) SelectListener(hello []byte) *Listener

func (*Router) Serve

func (r *Router) Serve() error

Jump to

Keyboard shortcuts

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