org.cybergarage.upnp.ssdp

## Class HTTPUSocket

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

- Direct Known Subclasses:
    SSDPSearchResponseSocket

      public class HTTPUSocket
      extends Object

  UDP socket implementation for SSDP (Simple Service Discovery Protocol) communication.

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

  Key features:

  - UDP unicast socket management
  - IPv4 and IPv6 support
  - Packet sending and receiving
  - Timestamp tracking for received packets
  - Network interface binding

  This class is used by SSDP components to send discovery messages (M-SEARCH) and receive device advertisements (NOTIFY messages) over UDP multicast and unicast communication.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HTTPUSocket()`
    `HTTPUSocket(int bindPort)`
    `HTTPUSocket(String bindAddr, int bindPort)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `close()`
    `protected void` | `finalize()`
    `DatagramSocket` | `getDatagramSocket()`
    `String` | `getLocalAddress()`
    `DatagramSocket` | `getUDPSocket()`
    `boolean` | `open()`
    `boolean` | `open(int bindPort)`
    `boolean` | `open(String bindAddr, int bindPort)`
    `boolean` | `post(String addr, int port, String msg)`
    `SSDPPacket` | `receive()`
    `void` | `setLocalAddress(String addr)`
    `String` | `toString()` I2P

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

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

- - ### Constructor Detail

    - #### HTTPUSocket

          public HTTPUSocket()

    - #### HTTPUSocket

          public HTTPUSocket(int bindPort)

    - #### HTTPUSocket

          public HTTPUSocket(String bindAddr,
                             int bindPort)

  - ### Method Detail

    - #### close

          public boolean close()

    - #### finalize

          protected void finalize()

      Overrides:
        `finalize` in class `Object`

    - #### getDatagramSocket

          public DatagramSocket getDatagramSocket()

    - #### getLocalAddress

          public String getLocalAddress()

    - #### getUDPSocket

          public DatagramSocket getUDPSocket()

      Returns:
        `DatagramSocket` open for receieving packets

    - #### open

          public boolean open()

    - #### open

          public boolean open(int bindPort)

    - #### open

          public boolean open(String bindAddr,
                              int bindPort)

    - #### post

          public boolean post(String addr,
                              int port,
                              String msg)

    - #### receive

          public SSDPPacket receive()

    - #### setLocalAddress

          public void setLocalAddress(String addr)

    - #### toString

          public String toString()

      I2P
      Overrides:
        `toString` in class `Object`