|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.net.DatagramSocketClient org.apache.commons.net.discard.DiscardUDPClient
public class DiscardUDPClient
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.
DiscardTCPClient
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default discard port. |
Fields inherited from class org.apache.commons.net.DatagramSocketClient |
---|
_isOpen_, _socket_, _socketFactory_, _timeout_ |
Constructor Summary | |
---|---|
DiscardUDPClient()
|
Method Summary | |
---|---|
void |
send(byte[] data,
InetAddress host)
Same as send(data, data.length, host. |
void |
send(byte[] data,
int length,
InetAddress host)
Same as send(data, length, host. |
void |
send(byte[] data,
int length,
InetAddress host,
int port)
Sends the specified data to the specified server at the specified port. |
Methods inherited from class org.apache.commons.net.DatagramSocketClient |
---|
close, getDefaultTimeout, getLocalAddress, getLocalPort, getSoTimeout, isOpen, open, open, open, setDatagramSocketFactory, setDefaultTimeout, setSoTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
Constructor Detail |
---|
public DiscardUDPClient()
Method Detail |
---|
public void send(byte[] data, int length, InetAddress host, int port) throws IOException
data
- The discard data to send.length
- The length of the data to send. Should be less than
or equal to the length of the data byte array.host
- The address of the server.port
- The service port.
IOException
- If an error occurs during the datagram send
operation.public void send(byte[] data, int length, InetAddress host) throws IOException
send(data, length, host. DiscardUDPClient.DEFAULT_PORT)
.
IOException
public void send(byte[] data, InetAddress host) throws IOException
send(data, data.length, host. DiscardUDPClient.DEFAULT_PORT)
.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |