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: 0

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