public class DiscardUDPClient extends DatagramSocketClient
open
and call send to send datagrams to the server
After you're done sending discard data, call
close()
to clean up properly.DiscardTCPClient| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
The default discard port.
|
_isOpen_, _socket_, _socketFactory_, _timeout_| Constructor and Description |
|---|
DiscardUDPClient() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
close, getCharset, getCharsetName, getDefaultTimeout, getLocalAddress, getLocalPort, getSoTimeout, isOpen, open, open, open, setCharset, setDatagramSocketFactory, setDefaultTimeout, setSoTimeoutpublic static final int DEFAULT_PORT
public DiscardUDPClient()
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).data - the buffer to sendlength - the length of the data in the bufferhost - the target hostIOException - if an error occurssend(byte[], int, InetAddress, int)public void send(byte[] data, InetAddress host) throws IOException
send(data, data.length, host. DiscardUDPClient.DEFAULT_PORT).data - the buffer to sendhost - the target hostIOException - if an error occurssend(byte[], int, InetAddress, int)Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.