public class DatagramSocket extends Object
Constructor and Description |
---|
DatagramSocket() |
DatagramSocket(int port) |
DatagramSocket(int port,
InetAddress inetaddress) |
Modifier and Type | Method and Description |
---|---|
int |
avail() |
void |
close()
close
|
void |
connect(InetAddress inetaddress,
int port) |
void |
disconnect()
disconnect
|
InetAddress |
getInetAddress() |
InetAddress |
getLocalAddress() |
int |
getLocalPort() |
int |
getPort() |
int |
getReceiveBufferSize() |
int |
getSendBufferSize() |
int |
getSoTimeout() |
void |
receive(DatagramPacket datagrampacket) |
void |
send(DatagramPacket datagrampacket) |
void |
setSecure(boolean negotiate) |
void |
setSendBufferSize() |
void |
setSoTimeout(int to) |
public DatagramSocket() throws SocketException
SocketException
- ?public DatagramSocket(int port) throws SocketException
port
- ?SocketException
- ?public DatagramSocket(int port, InetAddress inetaddress) throws SocketException
port
- ?inetaddress
- ?SocketException
- ?public void close()
public void connect(InetAddress inetaddress, int port)
inetaddress
- ?port
- ?public void disconnect()
public InetAddress getInetAddress()
public InetAddress getLocalAddress()
public int getLocalPort()
public int getPort()
public int getReceiveBufferSize()
public int getSendBufferSize()
public void setSendBufferSize() throws SocketException
SocketException
- ?public int getSoTimeout()
public void receive(DatagramPacket datagrampacket) throws IOException
datagrampacket
- ?IOException
- ?public int avail()
public void send(DatagramPacket datagrampacket) throws IOException
datagrampacket
- ?IOException
- ?public void setSoTimeout(int to)
to
- ?public void setSecure(boolean negotiate)
negotiate
- ?