Code example for DatagramPacket

Methods: setAddresssetDatasetLengthsetPort

0
     *            operation. 
     ***/ 
    public void send(byte[] data, int length, InetAddress host, int port)
    throws IOException 
    { 
        _sendPacket.setData(data);
        _sendPacket.setLength(length);
        _sendPacket.setAddress(host);
        _sendPacket.setPort(port);
        _socket_.send(_sendPacket);
    } 
 
 
    /*** 
     * Same as 
     * <code>send(data, length, host. DiscardUDPClient.DEFAULT_PORT)</code>. 
     ***/ 
    public void send(byte[] data, int length, InetAddress host)
    throws IOException 
    { 
Connect your IDE to all the code out there  Get Codota for Java