⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.net

Class DiscardUDPClient

java.lang.Object
|
+--org.apache.commons.net.DatagramSocketClient
   |
   +--org.apache.commons.net.DiscardUDPClient

Known Direct Subclasses:
EchoUDPClient


public class DiscardUDPClient
extends DatagramSocketClient

The DiscardUDPClient class is a UDP implementation of a client for the Discard protocol described in RFC 863. To use the class, just open a local UDP port with open and call send to send datagrams to the server After you're done sending discard data, call close() to clean up properly.

Author:
Daniel F. Savarese
See Also:
DiscardTCPClient

Field Summary

static int

DEFAULT_PORT

The default discard port.

Constructor Summary

DiscardUDPClient()

Method Summary

void

send(byte[] data, int length, InetAddress host, int port)

Sends the specified data to the specified server at the specified port.

void

send(byte[] data, int length, InetAddress host)

Same as send(data, length, host.

void

send(byte[] data, InetAddress host)

Same as send(data, data.length, host.

Field Details

DEFAULT_PORT

public static final int DEFAULT_PORT

The default discard port. It is set to 9 according to RFC 863. **

Constructor Details

DiscardUDPClient

public DiscardUDPClient()

Method Details

send

public void send(byte[] data, InetAddress host)

Same as send(data, data.length, host. DiscardUDPClient.DEFAULT_PORT).

Parameters:
data
host

send

public void send(byte[] data, int length, InetAddress host)

Same as send(data, length, host. DiscardUDPClient.DEFAULT_PORT).

Parameters:
data
length
host

send

public void send(byte[] data, int length, InetAddress host, int port)

Sends the specified data to the specified server at the specified port.

Parameters:
data - The discard data to send.
length - The length of the data to send.
host - The address of the server.
port - The service port.
Throws:
- If an error occurs during the datagram send operation.