server

package
v0.0.0-...-d9ae1e4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	ReadMessage() (int, []byte, error)
	WriteMessage(int, []byte) error
	Close() error
}

type Peer

type Peer struct {
	Id   string
	Conn Conn
	// contains filtered or unexported fields
}

func NewPeer

func NewPeer(id string, conn Conn) *Peer

func (*Peer) Broadcast

func (p *Peer) Broadcast() error

func (*Peer) Close

func (p *Peer) Close() error

func (*Peer) Connect

func (p *Peer) Connect(peer *Peer)

func (*Peer) Listen

func (p *Peer) Listen()

type PeerStopErr

type PeerStopErr struct {
	PeerId string
}

func (*PeerStopErr) Error

func (e *PeerStopErr) Error() string

type Session

type Session struct {
	Id   string
	Peer *Peer
}

type SessionManager

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

func NewSessionManager

func NewSessionManager() *SessionManager

func (*SessionManager) Register

func (s *SessionManager) Register(session Session)

func (*SessionManager) Unregister

func (s *SessionManager) Unregister(session Session)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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