yell/listener

OTP Actor that listens for multicast and unicast messages from SSDP services. Normally this actor is not used directly, but as a supervised child of the yell/monitor actor.

Types

A builder for the SSDP listener

pub opaque type Builder

A received SSDP message with its source IP address:

  • addr - The source IP address
  • content - The parsed SSDP message
pub type Message {
  Message(addr: glip.IpAddress, content: yell.Message)
}

Constructors

Values

pub fn new(addr: glip.IpAddress) -> Builder

Starts building a listener that will bind to a specific local interface address.

  • addr - The local IP address to listen on (needs to be a specific interface address). IPv6 is not currently supported due to a limitation in the underlying UDP library.
pub fn start(
  builder: Builder,
) -> Result(actor.Started(Nil), actor.StartError)

Start listening for multicast SSDP announcements and unicast SSDP replies. After parsing, SSDP messages are forwarded to all subscribed subjects.

pub fn subscribe(
  listener: Builder,
  with subscriber: process.Subject(Message),
) -> Builder

Subscribe a subject to receive messages from this listener. Multiple subjects can be subscribed.

pub fn supervised(
  builder: Builder,
) -> supervision.ChildSpecification(Nil)

Builds a worker child specification from a builder.

Search Document