multicast

package
v0.0.0-...-fd97e0e Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Multicast

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

Multicast servent main structure

func JoinMulticast

func JoinMulticast(addPeerCallback eventCallback, removePeerCallback eventCallback) *Multicast

JoinMulticast joins the Lantern multicast group. Two callbacks must be provided: the first will be called when a new peer is added to the list and the second will be called when removed. A nil callback will be considered an empty function and just do nothing.

func (*Multicast) LeaveMulticast

func (mc *Multicast) LeaveMulticast()

LeaveMulticast stops multicasting and leaves the group. This should be called by the users of this library when the program exits or the discovery service is disabled by the end user

func (*Multicast) ListenPeers

func (mc *Multicast) ListenPeers()

ListenPeers listens peers in previously joined multicast group

func (*Multicast) SetPayload

func (mc *Multicast) SetPayload(payload string)

SetPayload will define a payload to carry with multicast messages. Currently setting the payload once StartMulticast has been called is not supported, so this function must be called always before StartMulticast()

func (*Multicast) SetPeriod

func (mc *Multicast) SetPeriod(period int)

SetPeriod will define a different interval for the periodic multicasts. Currently setting the period once StartMulticast has been called is not supported, so this function must be called always before StartMulticast()

func (*Multicast) StartMulticast

func (mc *Multicast) StartMulticast()

StartMulticast initiates advertising ourselves through multicasting

type PeerInfo

type PeerInfo struct {
	IP      net.IP
	Time    time.Time
	Payload string
}

PeerInfo holds the information about a detected peer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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