Package org.cybergarage.upnp.ssdp
Class HTTPMUSocket
- java.lang.Object
-
- org.cybergarage.upnp.ssdp.HTTPMUSocket
-
- Direct Known Subclasses:
SSDPNotifySocket,SSDPSearchSocket
public class HTTPMUSocket extends Object
-
-
Constructor Summary
Constructors Constructor Description HTTPMUSocket()HTTPMUSocket(String addr, int port, String bindAddr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclose()protected voidfinalize()StringgetLocalAddress()intgetLocalPort()StringgetMulticastAddress()InetAddressgetMulticastInetAddress()intgetMulticastPort()MulticastSocketgetSocket()booleanopen(String addr, int port, String bindAddr)booleanopen(String addr, int port, InetAddress bindAddr)booleanpost(HTTPRequest req)booleanpost(HTTPRequest req, String bindAddr, int bindPort)SSDPPacketreceive()booleansend(String msg)booleansend(String msg, String bindAddr, int bindPort)
-
-
-
Method Detail
-
getLocalAddress
public String getLocalAddress()
-
getMulticastPort
public int getMulticastPort()
- Returns:
- the destination port for multicast packet
- Since:
- 1.8
-
getLocalPort
public int getLocalPort()
- Returns:
- the source port for multicast packet
- Since:
- 1.8
-
getSocket
public MulticastSocket getSocket()
- Returns:
- the opened
MulticastSocket - Since:
- 1.8
-
getMulticastInetAddress
public InetAddress getMulticastInetAddress()
-
getMulticastAddress
public String getMulticastAddress()
-
open
public boolean open(String addr, int port, InetAddress bindAddr)
- Parameters:
addr-Stringrappresenting the multicast hostname to join into.port- int rappresenting the port to be use poth as source and destinationbindAddr-InetAddresswhich identify the hostname of the interface to use for sending and recieving multicast packet
-
close
public boolean close()
-
send
public boolean send(String msg)
-
post
public boolean post(HTTPRequest req, String bindAddr, int bindPort)
-
post
public boolean post(HTTPRequest req)
-
receive
public SSDPPacket receive() throws IOException
- Throws:
IOException
-
-