org.cybergarage.upnp.ssdp

## Class HTTPMUSocket

- java.lang.Object
- - org.cybergarage.upnp.ssdp.HTTPMUSocket

- Direct Known Subclasses:
    SSDPNotifySocket, SSDPSearchSocket

      public class HTTPMUSocket
      extends Object

  Multicast UDP socket implementation for SSDP communication.

  This class provides multicast socket functionality specifically designed for SSDP operations in UPnP networks. It handles both sending and receiving multicast UDP packets for device discovery and advertisement.

  Key features:

  - Multicast socket management and configuration
  - SSDP multicast address handling
  - TTL (Time To Live) configuration
  - Network interface binding
  - Packet sending and receiving

  This class is used by SSDP components to send multicast discovery messages and receive multicast advertisements from UPnP devices, enabling the core device discovery functionality in UPnP networks.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HTTPMUSocket()`
    `HTTPMUSocket(String addr, int port, String bindAddr)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `close()`
    `protected void` | `finalize()`
    `String` | `getLocalAddress()`
    `int` | `getLocalPort()`
    `String` | `getMulticastAddress()`
    `InetAddress` | `getMulticastInetAddress()`
    `int` | `getMulticastPort()`
    `MulticastSocket` | `getSocket()`
    `boolean` | `open(String addr, int port, InetAddress bindAddr)`
    `boolean` | `open(String addr, int port, String bindAddr)`
    `boolean` | `post(HTTPRequest req)`
    `boolean` | `post(HTTPRequest req, String bindAddr, int bindPort)`
    `SSDPPacket` | `receive()`
    `boolean` | `send(String msg)`
    `boolean` | `send(String msg, String bindAddr, int bindPort)`
    `String` | `toString()` I2P

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### HTTPMUSocket

          public HTTPMUSocket()

    - #### HTTPMUSocket

          public HTTPMUSocket(String addr,
                              int port,
                              String bindAddr)

  - ### Method Detail

    - #### close

          public boolean close()

    - #### finalize

          protected void finalize()

      Overrides:
        `finalize` in class `Object`

    - #### getLocalAddress

          public String getLocalAddress()

    - #### getLocalPort

          public int getLocalPort()

      Returns:
        the source port for multicast packet

    - #### getMulticastAddress

          public String getMulticastAddress()

    - #### getMulticastInetAddress

          public InetAddress getMulticastInetAddress()

    - #### getMulticastPort

          public int getMulticastPort()

      Returns:
        the destination port for multicast packet

    - #### getSocket

          public MulticastSocket getSocket()

      Returns:
        the opened `MulticastSocket`

    - #### open

          public boolean open(String addr,
                              int port,
                              InetAddress bindAddr)

      Parameters:
        `addr` - `String` rappresenting the multicast hostname to join into.
        `port` - int rappresenting the port to be use poth as source and destination
        `bindAddr` - `InetAddress` which identify the hostname of the interface to use for sending and recieving multicast packet

    - #### open

          public boolean open(String addr,
                              int port,
                              String bindAddr)

    - #### post

          public boolean post(HTTPRequest req)

    - #### post

          public boolean post(HTTPRequest req,
                              String bindAddr,
                              int bindPort)

    - #### receive

          public SSDPPacket receive()
                             throws IOException

      Throws:
        `IOException`

    - #### send

          public boolean send(String msg)

    - #### send

          public boolean send(String msg,
                              String bindAddr,
                              int bindPort)

    - #### toString

          public String toString()

      I2P
      Overrides:
        `toString` in class `Object`