Package org.apache.commons.net.discard
Class DiscardUDPClient
java.lang.Object
org.apache.commons.net.DatagramSocketClient
org.apache.commons.net.discard.DiscardUDPClient
- All Implemented Interfaces:
- AutoCloseable
- Direct Known Subclasses:
- EchoUDPClient
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.- See Also:
- 
Field SummaryFieldsFields inherited from class org.apache.commons.net.DatagramSocketClient_isOpen_, _socket_, _socketFactory_, _timeout_
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidsend(byte[] data, int length, InetAddress host) Same assend(data, length, host.voidsend(byte[] data, int length, InetAddress host, int port) Sends the specified data to the specified server at the specified port.voidsend(byte[] data, InetAddress host) Same assend(data, data.length, host.Methods inherited from class org.apache.commons.net.DatagramSocketClientcheckOpen, close, getCharset, getCharsetName, getDefaultTimeout, getLocalAddress, getLocalPort, getSoTimeout, getSoTimeoutDuration, isOpen, open, open, open, setCharset, setDatagramSocketFactory, setDefaultTimeout, setDefaultTimeout, setSoTimeout, setSoTimeout
- 
Field Details- 
DEFAULT_PORTThe default discard port. It is set to 9 according to RFC 863.- See Also:
 
 
- 
- 
Constructor Details- 
DiscardUDPClientpublic DiscardUDPClient()
 
- 
- 
Method Details- 
sendSame assend(data, data.length, host. DiscardUDPClient.DEFAULT_PORT).- Parameters:
- data- the buffer to send
- host- the target host
- Throws:
- IOException- if an error occurs
- See Also:
 
- 
sendSame assend(data, length, host. DiscardUDPClient.DEFAULT_PORT).- Parameters:
- data- the buffer to send
- length- the length of the data in the buffer
- host- the target host
- Throws:
- IOException- if an error occurs
- See Also:
 
- 
sendSends 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. Should be less than or equal to the length of the data byte array.
- host- The address of the server.
- port- The service port.
- Throws:
- IOException- If an error occurs during the datagram send operation.
 
 
-