server

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: Apache-2.0, BSD-2-Clause Imports: 18 Imported by: 4

Documentation

Index

Constants

View Source
const (
	IDLE_TIMEOUT = 5 * time.Second

	STATE_INITIAL          = byte(255)
	STATE_INITIAL_ADDNODE  = byte(254)
	STATE_CONSECUTIVE      = byte(253)
	STATE_PING             = ping.MARSHALED_PACKET_HEADER
	STATE_ADD_NODE         = addnode.MARSHALED_PACKET_HEADER
	STATE_REMOVE_NODE      = removenode.MARSHALED_PACKET_HEADER
	STATE_CONNECT_NODES    = connectnodes.MARSHALED_PACKET_HEADER
	STATE_DISCONNECT_NODES = disconnectnodes.MARSHALED_PACKET_HEADER
)
View Source
const (
	CFG_SERVER_PORT = "analysis.server.port"
)

Variables

View Source
var (
	ErrInvalidPackageHeader          = errors.New("invalid package header")
	ErrExpectedInitialAddNodePackage = errors.New("expected initial add node package")
)
View Source
var Events = struct {
	AddNode         *events.Event
	RemoveNode      *events.Event
	ConnectNodes    *events.Event
	DisconnectNodes *events.Event
	NodeOnline      *events.Event
	NodeOffline     *events.Event
	Error           *events.Event
}{
	events.NewEvent(stringCaller),
	events.NewEvent(stringCaller),
	events.NewEvent(stringStringCaller),
	events.NewEvent(stringStringCaller),
	events.NewEvent(stringCaller),
	events.NewEvent(stringCaller),
	events.NewEvent(errorCaller),
}

Functions

func Configure

func Configure(plugin *node.Plugin)

func HandleConnection

func HandleConnection(conn *network.ManagedConnection)

func Run

func Run(plugin *node.Plugin)

func Shutdown

func Shutdown()

Types

type ConnectionState

type ConnectionState = byte

Jump to

Keyboard shortcuts

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