src

package
v0.0.0-...-6b95e37 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = ":9669"

DefaultPort is the default port when not set during runtime

Variables

This section is empty.

Functions

func IsListedNode

func IsListedNode(node *Node) bool

IsListedNode checks if the node is in the list

func Listen

func Listen()

Listen for incoming messages

func OpenConnection

func OpenConnection(IPAddress string) error

OpenConnection joins a bootstrap peer by IPAddress (includes PORT)

Types

type Node

type Node struct {
	Socket net.Conn
}

Node is a peer node

func ConnectToNode

func ConnectToNode(node Node) (*Node, error)

ConnectToNode initiates a connection with a remote node

func (*Node) GetIPAddress

func (node *Node) GetIPAddress() string

GetIPAddress returns the IP address of the node pointing on its default port

func (*Node) ProcessMessages

func (node *Node) ProcessMessages()

ProcessMessages processes all incoming messages

func (*Node) SendMessage

func (node *Node) SendMessage(msg protocol.Message) error

SendMessage sends a message to a node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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