Documentation ¶
Index ¶
Constants ¶
View Source
const ( //ErrInvalidPort invalid port provided ErrInvalidPort = errors.Error("lanBroadcast: Invalid port provided") //ErrHost unable to get the host address ErrHost = errors.Error("lanBroadcast: unable to get the host address or interface") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LANBroadcast ¶
type LANBroadcast struct {
// contains filtered or unexported fields
}
LANBroadcast a lan broadcaster
func (*LANBroadcast) Broadcast ¶
func (l *LANBroadcast) Broadcast(ctx context.Context)
Broadcast broadcasts the game to LAN. This function blocks until the given ctx is canceled or Close is called.
func (*LANBroadcast) Close ¶
func (l *LANBroadcast) Close()
Close close the LAN broadcaster. This function does not block and may be called more than once.
func (*LANBroadcast) SetInterval ¶
func (l *LANBroadcast) SetInterval(t uint)
SetInterval set the interval between broadcasts in seconds. This has no effect if called after calling `Broadcast()`.
func (*LANBroadcast) SetMOTD ¶
func (l *LANBroadcast) SetMOTD(message string)
SetMOTD set the message of the day
Click to show internal directories.
Click to hide internal directories.