org.teleal.cling.transport.spi
Interface NetworkAddressFactory
- All Known Implementing Classes:
- AndroidNetworkAddressFactory, NetworkAddressFactoryImpl
public interface NetworkAddressFactory
Configuration utility for network interfaces and addresses.
An implementation has to be thread-safe.
- Author:
- Christian Bauer
SYSTEM_PROPERTY_NET_IFACES
static final String SYSTEM_PROPERTY_NET_IFACES
- See Also:
- Constant Field Values
SYSTEM_PROPERTY_NET_ADDRESSES
static final String SYSTEM_PROPERTY_NET_ADDRESSES
- See Also:
- Constant Field Values
getMulticastGroup
InetAddress getMulticastGroup()
- Returns:
- The UDP multicast group to join.
getMulticastPort
int getMulticastPort()
- Returns:
- The UDP multicast port to listen on.
getStreamListenPort
int getStreamListenPort()
- Returns:
- The TCP (HTTP) stream request port to listen on.
getNetworkInterfaces
NetworkInterface[] getNetworkInterfaces()
- Returns:
- The local network interfaces on which multicast groups will be joined.
getBindAddresses
InetAddress[] getBindAddresses()
- Returns:
- The local addresses of the network interfaces bound to
sockets listening for unicast datagrams and TCP requests.
getHardwareAddress
byte[] getHardwareAddress(InetAddress inetAddress)
- Parameters:
inetAddress
- An address of a local network interface.
- Returns:
- The MAC hardware address of the network interface or
null
if no
hardware address could be obtained.
getBroadcastAddress
InetAddress getBroadcastAddress(InetAddress inetAddress)
- Parameters:
inetAddress
- An address of a local network interface.
- Returns:
- The broadcast address of the network (interface) or
null
if no
broadcast address could be obtained.
getLocalAddress
InetAddress getLocalAddress(NetworkInterface networkInterface,
boolean isIPv6,
InetAddress remoteAddress)
throws IllegalStateException
- Best-effort attempt finding a reachable local address for a given remote host.
This method is called whenever a multicast datagram has been received. We need to be
able to communicate with the sender using UDP unicast and we need to tell the sender
how we are reachable with TCP requests. We need a local address that is in the same
subnet as the senders address, that is reachable from the senders point of view.
- Parameters:
networkInterface
- The network interface to examine.isIPv6
- True if the given remote address is an IPv6 address.remoteAddress
- The remote address for which to find a local address in the same subnet.
- Returns:
- A local address that is reachable from the given remote address.
- Throws:
IllegalStateException
- If no local address reachable by the remote address has been found.
Copyright © 2011 Teleal GmbH, Switzerland. All Rights Reserved.