APIdia Launch Partner
Top Description Fields Constructors Methods
sun.management.jdp

public final Class JdpBroadcaster

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.Inet6Address, .InetAddress, .InetSocketAddress, .NetworkInterface, .ProtocolFamily, .StandardProtocolFamily, .StandardSocketOptions, java.nio.ByteBuffer, java.nio.channels.DatagramChannel, .UnsupportedAddressTypeException, java.util.Enumeration

JdpBroadcaster is responsible for sending pre-built JDP packet across a Net

Multicast group address, port number and ttl have to be chosen on upper level and passed to broadcaster constructor. Also it's possible to specify source address to broadcast from.

JdpBradcaster doesn't perform any validation on a supplied port and ttl because the allowed values depend on an operating system setup

Field Summary

Modifier and TypeField and Description
private final InetAddress
private final DatagramChannel
private final int

Constructor Summary

AccessConstructor and Description
public
JdpBroadcaster(InetAddress
- multicast group address
address
,
InetAddress
- address of interface we should use to broadcast.
srcAddress
,
int
- udp port to use
port
,
int
- packet ttl
ttl
)

Create a new broadcaster

public
JdpBroadcaster(InetAddress
- multicast group address
address
,
int
- udp port to use
port
,
int
- packet ttl
ttl
)

Create a new broadcaster

Method Summary

Modifier and TypeMethod and Description
public void
sendPacket(JdpPacket
- instance of JdpPacket
packet
)

Broadcast pre-built packet

public void
shutdown()

Shutdown broadcaster and close underlying socket channel

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addrback to summary
private final InetAddress addr
channelback to summary
private final DatagramChannel channel
portback to summary
private final int port

Constructor Detail

JdpBroadcasterback to summary
public JdpBroadcaster(InetAddress address, InetAddress srcAddress, int port, int ttl) throws IOException, JdpException

Create a new broadcaster

Parameters
address:InetAddress

- multicast group address

srcAddress:InetAddress

- address of interface we should use to broadcast.

port:int

- udp port to use

ttl:int

- packet ttl

JdpBroadcasterback to summary
public JdpBroadcaster(InetAddress address, int port, int ttl) throws IOException, JdpException

Create a new broadcaster

Parameters
address:InetAddress

- multicast group address

port:int

- udp port to use

ttl:int

- packet ttl

Method Detail

sendPacketback to summary
public void sendPacket(JdpPacket packet) throws IOException

Broadcast pre-built packet

Parameters
packet:JdpPacket

- instance of JdpPacket

shutdownback to summary
public void shutdown() throws IOException

Shutdown broadcaster and close underlying socket channel