java.lang.Object
org.cybergarage.upnp.ssdp.HTTPMUSocket
org.cybergarage.upnp.ssdp.SSDPNotifySocket
All Implemented Interfaces:
Runnable

public class SSDPNotifySocketextends HTTPMUSocket implements Runnable
This class identifies a SSDP socket only for notifying packet.
  • Constructor Details

    • SSDPNotifySocket

      public SSDPNotifySocket(String bindAddr) throws IOException
      Opens a notification socket bound to one local address.
      Parameters:
      bindAddr - the local address the socket is bound to, which also decides whether an IPv4 or IPv6 multicast group is joined
      Throws:
      IOException - if the socket cannot be bound to the given address
  • Method Details

    • setControlPoint

      public void setControlPoint(ControlPoint ctrlp)
      Attaches the control point that receives notifications from this socket.
      Parameters:
      ctrlp - the control point that should receive the notifications sent through this socket, or null to detach the current one
    • getControlPoint

      public ControlPoint getControlPoint()
      Gets the attached control point.
      Returns:
      the control point set by setControlPoint, or null if none is set
    • post

      public boolean post(SSDPNotifyRequest req)
      This method send a SSDPNotifyRequest over SSDPNotifySocket
      Parameters:
      req - the SSDPNotifyRequest to send
      Returns:
      true if and only if the transmission succeeded
      Because it rely on UDP doesn't mean that it's also received
    • run

      public void run()
      Receives multicast notifications and forwards them to the control point.
      Specified by:
      run in interface Runnable
    • start

      public void start()
      Starts the thread that receives notifications on this socket.
    • stop

      public void stop()
      Stops the receiving thread and closes the socket.