metpoll

package module
v0.0.0-...-3db8cd0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 11 Imported by: 0

README

metpoll

Golang Reactor netpoll

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTcpSocketAddr

func GetTcpSocketAddr(addr string) (sa unix.Sockaddr, tcpAddr *net.TCPAddr, err error)

func NewEngine

func NewEngine(ps int) *engine

func TCPSocket

func TCPSocket(addr string, passive bool) (int, net.Addr, error)

Types

type Connect

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

func (*Connect) Close

func (c *Connect) Close()

func (*Connect) Read

func (c *Connect) Read()

读取数据

func (*Connect) Write

func (c *Connect) Write(data []byte)

type LB

type LB interface {
	Cur() int
	Set(t int)
}

type MSocket

type MSocket struct {
}

type Poller

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

func NewPoller

func NewPoller() *Poller

func (*Poller) AddConn

func (p *Poller) AddConn(conn *Connect)

func (*Poller) CloseConn

func (p *Poller) CloseConn(fd int) error

func (*Poller) DelConn

func (p *Poller) DelConn(fd int)

func (*Poller) EpollAddEvent

func (p *Poller) EpollAddEvent(fd int) error

func (*Poller) EpollRemoveEvent

func (p *Poller) EpollRemoveEvent(fd int) error

func (*Poller) GetConn

func (p *Poller) GetConn(fd int) *Connect

func (*Poller) HandlerEpoll

func (p *Poller) HandlerEpoll() error

处理epoll

type RoundRobinBalance

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

func (*RoundRobinBalance) Cur

func (rrb *RoundRobinBalance) Cur() int

func (*RoundRobinBalance) Set

func (rrb *RoundRobinBalance) Set(t int)

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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