net

package
v0.0.0-...-370eddc Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_TTL = 20
View Source
const MULTICAST_PORT = 7788

Variables

View Source
var MULTICAST_ADDR = &net.UDPAddr{IP: MULTICAST_IP, Port: MULTICAST_PORT}
View Source
var MULTICAST_IP = net.IPv4(224, 0, 0, 64)

Functions

func BroadcastInRing

func BroadcastInRing(ctx *common.Context, cmd common.Command)

func ForwardInRing

func ForwardInRing(ctx *common.Context, from common.PeerAddr, cmd common.Command)

func ReplyInRing

func ReplyInRing(ctx *common.Context, from common.PeerAddr, cmd common.Command)

func SendToDirectly

func SendToDirectly(ctx *common.Context, destination common.PeerAddr, cmd common.Command) error

func SendToHi

func SendToHi(ctx *common.Context, cmd common.Command, report bool)

func SendToHiReliable

func SendToHiReliable(ctx *common.Context, cmd common.Command)

func SendToLo

func SendToLo(ctx *common.Context, cmd common.Command, report bool)

func SendToLoReliable

func SendToLoReliable(ctx *common.Context, cmd common.Command)

func SendToReliable

func SendToReliable(ctx *common.Context, mainDest common.PeerAddr, altDest common.PeerAddr, cmd common.Command)

func SendToRingLeader

func SendToRingLeader(ctx *common.Context, cmd common.Command)

func StartChRoTimer

func StartChRoTimer(ctx *common.Context)

Types

type DiscoveryServer

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

func NewDiscoveryServer

func NewDiscoveryServer(ctx *common.Context, discoverResponse string,
	discoveryEventHandler func(discoverResponse string)) *DiscoveryServer

func (*DiscoveryServer) SendDiscoveryRequest

func (s *DiscoveryServer) SendDiscoveryRequest()

func (*DiscoveryServer) SendDiscoveryRequestOn

func (s *DiscoveryServer) SendDiscoveryRequestOn(iface *net.Interface)

func (*DiscoveryServer) StartOn

func (s *DiscoveryServer) StartOn(iface *net.Interface)

type TcpServer

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

func NewTcpServer

func NewTcpServer(context *common.Context) *TcpServer

func (*TcpServer) Listen

func (s *TcpServer) Listen()

func (*TcpServer) Port

func (s *TcpServer) Port() int

Jump to

Keyboard shortcuts

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