connection

package
v0.0.0-...-a3aafb5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	OK        bool
	Protected bool
	Conn      net.Conn
	Mu        sync.Mutex
	Payload   interface{}
}

func New

func New(c net.Conn) *Connection

func (*Connection) Alive

func (c *Connection) Alive() bool

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) ImmunityNextClose

func (c *Connection) ImmunityNextClose()

func (*Connection) Load

func (c *Connection) Load() interface{}

func (*Connection) Store

func (c *Connection) Store(data interface{})

func (*Connection) Write

func (c *Connection) Write(b []byte) (n int, err error)

type Dispatcher

type Dispatcher struct {
	PriCtrlConns map[string]*Connection
	PriRevsChans map[uint64]chan *Connection

	PCCMutex sync.RWMutex // PriCtrlConns Mutex
	PRCMutex sync.Mutex   // PriRevsConns Mutex
}
var DP *Dispatcher

func (*Dispatcher) GetPriCtrlConn

func (d *Dispatcher) GetPriCtrlConn(host string) (c *Connection, has bool)

func (*Dispatcher) GetPriRevsChan

func (d *Dispatcher) GetPriRevsChan(key uint64) (ch chan *Connection, has bool)

func (*Dispatcher) NewPriRevsChan

func (d *Dispatcher) NewPriRevsChan(key uint64) chan *Connection

func (*Dispatcher) RegPriCtrlConn

func (d *Dispatcher) RegPriCtrlConn(host string, c *Connection) (ok bool)

func (*Dispatcher) RemPriRevsChan

func (d *Dispatcher) RemPriRevsChan(key uint64)

Jump to

Keyboard shortcuts

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