AEDAserver

package
v0.0.0-...-2e12031 Latest Latest
Warning

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

Go to latest
Published: May 26, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientMessage

type ClientMessage struct {
	Addr  *net.UDPAddr
	Event eventmessage.EventMessage
}

type Server

type Server interface {
	Start()
	Close()
	ServerWriter
	ServerStats
}

type ServerStats

type ServerStats interface {
	GetServerStats() SrvStats
}

type ServerWriter

type ServerWriter interface {
	Write(addr *net.UDPAddr, msg []byte)
}

type SrvStats

type SrvStats struct {
	Pktssentcnt int
	Pktsrecvcnt int
	Pktserrcnt  int
}

type UDPPacket

type UDPPacket struct {
	Addr *net.UDPAddr
	Buf  []byte
}

type UDPServer

type UDPServer struct {
	DebugMode bool

	Conn    *net.UDPConn
	Addr    *net.UDPAddr
	Clients []net.UDPAddr
	Stats   SrvStats

	ResQueue chan ClientMessage
	// contains filtered or unexported fields
}

func CreateUDPServer

func CreateUDPServer(port int, ccfg AEDAcrypt.CryptCfg) (*UDPServer, error)

CreateUDPServer returns a new UDP server with the provided parameters

func (*UDPServer) Close

func (srv *UDPServer) Close()

Close closes the server and no more packages are read from UDP

func (*UDPServer) GetServerStats

func (srv *UDPServer) GetServerStats() SrvStats

GetServerStats returns the current stats of the server like transfered packages

func (*UDPServer) Start

func (srv *UDPServer) Start() error

Start starts receiving UDP packages for the server

func (*UDPServer) Write

func (srv *UDPServer) Write(addr *net.UDPAddr, msg []byte)

Jump to

Keyboard shortcuts

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