net

package
Version: v0.0.0-...-07f90b3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_LISTEN_ADDRESS string   = "127.0.0.1"
	DEFAULT_ANSWER_ADDRESS string   = "127.0.0.1"
	MIN_PORT_NUMBER        int      = 69
	MAX_PORT_NUMBER        int      = 55000
	PIPE_IN                PipeType = iota + 1
	PIPE_OUT
	PIPE_INOUT
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NetPipe

type NetPipe interface {
	Start() error
	Stop()
	IsRunning() bool
	GetInputChannel() (<-chan []byte, error)
	GetOutputChannel() (chan []byte, error)
	Write(d []byte) (int, error)
}

func New

func New(pType PipeType, inputPort int, outputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

func NewInputOutputPipe

func NewInputOutputPipe(inputPort int, outputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

func NewInputOutputPipeWith

func NewInputOutputPipeWith(listenIp string, inputPort int, answerIp string, outputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

func NewInputPipe

func NewInputPipe(inputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

func NewInputPipeWith

func NewInputPipeWith(listenIp string, inputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

func NewNetPipe

func NewNetPipe(pType PipeType, listenAddress string, inputPort int, answerAddress string, outputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

func NewOutputPipe

func NewOutputPipe(outputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

func NewOutputPipeWith

func NewOutputPipeWith(answerIp string, outputPort int, handler PipeHandler, logger log.Logger) (NetPipe, error)

type PipeHandler

type PipeHandler func(message string)

type PipeType

type PipeType byte

func (*PipeType) String

func (t *PipeType) String() string

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL