server

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: GPL-3.0 Imports: 11 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientNotExists = fmt.Errorf("client session is not exists")
	ErrClientIDReused  = fmt.Errorf("client id is reused. %w", ErrClientNotExists)
)

Functions

func ExportClients

func ExportClients(hub *Hub) map[uint64]*bash.Client

Types

type Header [12]byte

func (*Header) ID

func (h *Header) ID() uint64

func (*Header) MsgType

func (h *Header) MsgType() MsgType

func (*Header) String

func (h *Header) String() string

func (*Header) Version

func (h *Header) Version() uint8

type Hub

type Hub struct {
	OnSessionOpen func(bash.Session) func()
	Timeout       time.Duration
	// contains filtered or unexported fields
}

func NewHub

func NewHub() *Hub

func (*Hub) Close

func (hub *Hub) Close() (err error)

func (*Hub) NewClientSession

func (hub *Hub) NewClientSession(conn net.Conn) (err error)

func (*Hub) Serve

func (hub *Hub) Serve(l net.Listener) (err error)

func (*Hub) ServeConn

func (hub *Hub) ServeConn(conn net.Conn) (err error)

type MsgType

type MsgType uint8
const (
	MsgToSession MsgType = iota
	MsgInitSession
)

Jump to

Keyboard shortcuts

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