/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* JdpBroadcaster is responsible for sending pre-built JDP packet across a Net
*
* <p> 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. </p>
*
* <p>JdpBradcaster doesn't perform any validation on a supplied {@code port} and {@code ttl} because
* the allowed values depend on an operating system setup</p>
*
*/
public final class JdpBroadcaster {
private final int port;
/**
* Create a new broadcaster
*
* @param address - multicast group address
* @param srcAddress - address of interface we should use to broadcast.
* @param port - udp port to use
* @param ttl - packet ttl
* @throws IOException
*/
throws IOException, JdpException {
// with srcAddress equal to null, this constructor do exactly the same as
// if srcAddress is not passed
if (srcAddress != null) {
// User requests particular interface to bind to
try {
} catch (UnsupportedAddressTypeException ex) {
throw new JdpException("Unable to bind to source address");
}
}
}
/**
* Create a new broadcaster
*
* @param address - multicast group address
* @param port - udp port to use
* @param ttl - packet ttl
* @throws IOException
*/
throws IOException, JdpException {
}
/**
* Broadcast pre-built packet
*
* @param packet - instance of JdpPacket
* @throws IOException
*/
throws IOException {
}
/**
* Shutdown broadcaster and close underlying socket channel
*
* @throws IOException
*/
}
}