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 ¶
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 ¶
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