p2pnetwork

package
Version: v0.0.0-...-0efea2d Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P2pNetwork

type P2pNetwork interface {
	BroadCast(v interface{}) error
	SendToNode(nodeID int64, v interface{}) error
}

func NewSimpleP2pLib

func NewSimpleP2pLib(id int64, msgChan chan<- *message.ConMessage) P2pNetwork

type SimpleP2p

type SimpleP2p struct {
	SrvBub  *net.TCPListener
	Peers   map[string]*net.TCPConn
	MsgChan chan<- *message.ConMessage
}

func (*SimpleP2p) BroadCast

func (sp *SimpleP2p) BroadCast(v interface{}) error

func (*SimpleP2p) SendToNode

func (sp *SimpleP2p) SendToNode(nodeID int64, v interface{}) error

Jump to

Keyboard shortcuts

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