mux

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

This module is used for port reuse Distinguish client, web manager , HTTP and HTTPS according to the difference of protocol

Index

Constants

View Source
const (
	HTTP_GET        = 716984
	HTTP_POST       = 807983
	HTTP_HEAD       = 726965
	HTTP_PUT        = 808585
	HTTP_DELETE     = 686976
	HTTP_CONNECT    = 677978
	HTTP_OPTIONS    = 798084
	HTTP_TRACE      = 848265
	CLIENT          = 848384
	ACCEPT_TIME_OUT = 10
)

Variables

This section is empty.

Functions

func NewBandwidth added in v0.26.0

func NewBandwidth(fd *os.File) *bandwidth

func NewConn

func NewConn(connId int32, mux *Mux, label ...string) *conn

func NewConnMap

func NewConnMap() *connMap

func NewListElement added in v0.26.0

func NewListElement(buf []byte, l uint16, part bool) (element *common.ListElement, err error)

func NewLogServer added in v0.26.0

func NewLogServer()

func NewWriteBandwidth added in v0.26.0

func NewWriteBandwidth() *writeBandwidth

func ReadLenBytes

func ReadLenBytes(buf []byte, r io.Reader) (int, error)

read bytes by length

func WriteLenBytes

func WriteLenBytes(buf []byte, w io.Writer) (int, error)

write bytes with int32 length

Types

type ConnQueue added in v0.26.0

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

func (*ConnQueue) New added in v0.26.0

func (Self *ConnQueue) New()

func (*ConnQueue) Pop added in v0.26.0

func (Self *ConnQueue) Pop() (connection *conn)

func (*ConnQueue) Push added in v0.26.0

func (Self *ConnQueue) Push(connection *conn)

func (*ConnQueue) Stop added in v0.26.0

func (Self *ConnQueue) Stop()

func (*ConnQueue) TryPop added in v0.26.0

func (Self *ConnQueue) TryPop() (connection *conn)

type IntSlice added in v0.26.0

type IntSlice []int

func (IntSlice) Len added in v0.26.0

func (s IntSlice) Len() int

func (IntSlice) Less added in v0.26.0

func (s IntSlice) Less(i, j int) bool

func (IntSlice) Swap added in v0.26.0

func (s IntSlice) Swap(i, j int)

type Mux

type Mux struct {
	net.Listener

	IsClose bool
	// contains filtered or unexported fields
}

func NewMux

func NewMux(c net.Conn, connType string) *Mux

func (*Mux) Accept

func (s *Mux) Accept() (net.Conn, error)

func (*Mux) Addr

func (s *Mux) Addr() net.Addr

func (*Mux) Close

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

func (*Mux) NewConn

func (s *Mux) NewConn() (*conn, error)

type PortConn added in v0.18.1

type PortConn struct {
	Conn net.Conn
	// contains filtered or unexported fields
}

func (*PortConn) Close added in v0.18.1

func (pConn *PortConn) Close() error

func (*PortConn) LocalAddr added in v0.18.1

func (pConn *PortConn) LocalAddr() net.Addr

func (*PortConn) Read added in v0.18.1

func (pConn *PortConn) Read(b []byte) (n int, err error)

func (*PortConn) RemoteAddr added in v0.18.1

func (pConn *PortConn) RemoteAddr() net.Addr

func (*PortConn) SetDeadline added in v0.18.1

func (pConn *PortConn) SetDeadline(t time.Time) error

func (*PortConn) SetReadDeadline added in v0.18.1

func (pConn *PortConn) SetReadDeadline(t time.Time) error

func (*PortConn) SetWriteDeadline added in v0.18.1

func (pConn *PortConn) SetWriteDeadline(t time.Time) error

func (*PortConn) Write added in v0.18.1

func (pConn *PortConn) Write(b []byte) (n int, err error)

type PortListener added in v0.18.1

type PortListener struct {
	net.Listener
	// contains filtered or unexported fields
}

func NewPortListener added in v0.18.1

func NewPortListener(connCh chan *PortConn, addr net.Addr) *PortListener

func (*PortListener) Accept added in v0.18.1

func (pListener *PortListener) Accept() (net.Conn, error)

func (*PortListener) Addr added in v0.18.1

func (pListener *PortListener) Addr() net.Addr

func (*PortListener) Close added in v0.18.1

func (pListener *PortListener) Close() error

type PortMux added in v0.18.1

type PortMux struct {
	net.Listener
	// contains filtered or unexported fields
}

func NewPortMux added in v0.18.1

func NewPortMux(port int, managerHost string) *PortMux

func (*PortMux) Close added in v0.18.1

func (pMux *PortMux) Close() error

func (*PortMux) GetClientListener added in v0.18.1

func (pMux *PortMux) GetClientListener() net.Listener

func (*PortMux) GetHttpListener added in v0.18.1

func (pMux *PortMux) GetHttpListener() net.Listener

func (*PortMux) GetHttpsListener added in v0.18.1

func (pMux *PortMux) GetHttpsListener() net.Listener

func (*PortMux) GetManagerListener added in v0.18.1

func (pMux *PortMux) GetManagerListener() net.Listener

func (*PortMux) Start added in v0.18.1

func (pMux *PortMux) Start() error

type PriorityQueue added in v0.26.0

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

func (*PriorityQueue) New added in v0.26.0

func (Self *PriorityQueue) New()

func (*PriorityQueue) Pop added in v0.26.0

func (Self *PriorityQueue) Pop() (packager *common.MuxPackager)

func (*PriorityQueue) Push added in v0.26.0

func (Self *PriorityQueue) Push(packager *common.MuxPackager)

func (*PriorityQueue) Stop added in v0.26.0

func (Self *PriorityQueue) Stop()

func (*PriorityQueue) TryPop added in v0.26.0

func (Self *PriorityQueue) TryPop() (packager *common.MuxPackager)

type ReceiveWindow added in v0.26.0

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

func (*ReceiveWindow) CloseWindow added in v0.26.0

func (Self *ReceiveWindow) CloseWindow()

func (*ReceiveWindow) New added in v0.26.0

func (Self *ReceiveWindow) New(mux *Mux)

func (*ReceiveWindow) Read added in v0.26.0

func (Self *ReceiveWindow) Read(p []byte, id int32) (n int, err error)

func (*ReceiveWindow) SetTimeOut added in v0.26.0

func (Self *ReceiveWindow) SetTimeOut(t time.Time)

func (*ReceiveWindow) Stop added in v0.26.0

func (Self *ReceiveWindow) Stop()

func (*ReceiveWindow) Write added in v0.26.0

func (Self *ReceiveWindow) Write(buf []byte, l uint16, part bool, id int32) (err error)

type ReceiveWindowQueue added in v0.26.0

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

func NewReceiveWindowQueue added in v0.26.0

func NewReceiveWindowQueue() *ReceiveWindowQueue

func (*ReceiveWindowQueue) Len added in v0.26.0

func (Self *ReceiveWindowQueue) Len() (n uint32)

func (*ReceiveWindowQueue) Pop added in v0.26.0

func (Self *ReceiveWindowQueue) Pop() (element *common.ListElement, err error)

func (*ReceiveWindowQueue) Push added in v0.26.0

func (Self *ReceiveWindowQueue) Push(element *common.ListElement)

func (*ReceiveWindowQueue) SetTimeOut added in v0.26.0

func (Self *ReceiveWindowQueue) SetTimeOut(t time.Time)

func (*ReceiveWindowQueue) Stop added in v0.26.0

func (Self *ReceiveWindowQueue) Stop()

func (*ReceiveWindowQueue) TryPop added in v0.26.0

func (Self *ReceiveWindowQueue) TryPop() (element *common.ListElement)

type SendWindow added in v0.26.0

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

func (*SendWindow) CloseWindow added in v0.26.0

func (Self *SendWindow) CloseWindow()

func (*SendWindow) New added in v0.26.0

func (Self *SendWindow) New(mux *Mux)

func (*SendWindow) SetSendBuf added in v0.26.0

func (Self *SendWindow) SetSendBuf(buf []byte)

func (*SendWindow) SetSize added in v0.26.0

func (Self *SendWindow) SetSize(currentMaxSizeDone uint64) (closed bool)

func (*SendWindow) SetTimeOut added in v0.26.0

func (Self *SendWindow) SetTimeOut(t time.Time)

func (*SendWindow) WriteFull added in v0.26.0

func (Self *SendWindow) WriteFull(buf []byte, id int32) (n int, err error)

func (*SendWindow) WriteTo added in v0.26.0

func (Self *SendWindow) WriteTo() (p []byte, sendSize uint32, part bool, err error)

Jump to

Keyboard shortcuts

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