Code example for DatagramPacket

Methods: setAddresssetPort

     * @param port The port of the service. 
     * @exception IOException If an error occurs while sending the datagram. 
    public void send(InetAddress host, int port) throws IOException
    /*** Same as <code>send(host, CharGenUDPClient.DEFAULT_PORT);</code> ***/ 
    public void send(InetAddress host) throws IOException
        send(host, DEFAULT_PORT);
     * Receive the reply data from the server.  This will always be 512 bytes 
     * or less.  Chargen and quote of the day only return one packet.  Netstat 
     * and systat require multiple calls to receive() with timeout detection. 
     * <p>