| java.lang.Object org.apache.commons.net.DatagramSocketClient org.apache.commons.net.DiscardUDPClient org.apache.commons.net.EchoUDPClient
Field Summary | |
final public static int | DEFAULT_PORT The default echo port. |
Method Summary | |
public int | receive(byte[] data, int length) Receives echoed data and returns its length. | public int | receive(byte[] data) | public void | send(byte[] data, int length, InetAddress host) Sends the specified data to the specified server at the default echo
port.
Parameters: data - The echo data to send. Parameters: length - The length of the data to send. | public void | send(byte[] data, InetAddress host) |
DEFAULT_PORT | final public static int DEFAULT_PORT(Code) | | The default echo port. It is set to 7 according to RFC 862. **
|
receive | public int receive(byte[] data, int length) throws IOException(Code) | | Receives echoed data and returns its length. The data may be divided
up among multiple datagrams, requiring multiple calls to receive.
Also, the UDP packets will not necessarily arrive in the same order
they were sent.
Length of actual data received. exception: IOException - If an error occurs while receiving the data. |
receive | public int receive(byte[] data) throws IOException(Code) | | Same as receive(data, data.length) **
|
send | public void send(byte[] data, int length, InetAddress host) throws IOException(Code) | | Sends the specified data to the specified server at the default echo
port.
Parameters: data - The echo data to send. Parameters: length - The length of the data to send. Should be less thanor equal to the length of the data byte array. Parameters: host - The address of the server. exception: IOException - If an error occurs during the datagram sendoperation. |
|
|