Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
Broadcaster sends identity packets over UDP to advertise the local device.
func NewBroadcaster ¶
func NewBroadcaster(identity *protocol.Packet, interval time.Duration, logger *zap.Logger) *Broadcaster
NewBroadcaster creates a UDP discovery broadcaster.
func (*Broadcaster) Run ¶
func (b *Broadcaster) Run(ctx context.Context, shouldReduce func() bool)
Run periodically sends the identity packet to 255.255.255.255:1716. If shouldReduce is provided and returns true, the broadcast frequency is reduced to 60 seconds to save CPU and network resources while idle.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener listens for UDP identity packets from other devices.
Click to show internal directories.
Click to hide internal directories.