Module java.base
Package java.net

# Class DatagramSocket

=
public class DatagramSocket
extends java.lang.Object
implements java.io.Closeable

## Constructors

- =
  public DatagramSocket() throws java.net.SocketException
- =
  public DatagramSocket(int arg0) throws java.net.SocketException
- =
  public DatagramSocket(int arg0, java.net.InetAddress arg1) throws java.net.SocketException
- =
  protected DatagramSocket(java.net.DatagramSocketImpl arg0)
- =
  public DatagramSocket(java.net.SocketAddress arg0) throws java.net.SocketException

## Methods

- =
  public void bind(java.net.SocketAddress arg0) throws java.net.SocketException
- =
  public void close()
- =
  public void connect(java.net.InetAddress arg0, int arg1)
- =
  public void connect(java.net.SocketAddress arg0) throws java.net.SocketException
- =
  public void disconnect()
- =
  public boolean getBroadcast() throws java.net.SocketException
- =
  public java.nio.channels.DatagramChannel getChannel()
- =
  public java.net.InetAddress getInetAddress()
- =
  public java.net.InetAddress getLocalAddress()
- =
  public int getLocalPort()
- =
  public java.net.SocketAddress getLocalSocketAddress()
- =
  public <T> T getOption(java.net.SocketOption<T> arg0) throws java.io.IOException
- =
  public int getPort()
- =
  public int getReceiveBufferSize() throws java.net.SocketException
- =
  public java.net.SocketAddress getRemoteSocketAddress()
- =
  public boolean getReuseAddress() throws java.net.SocketException
- =
  public int getSendBufferSize() throws java.net.SocketException
- =
  public int getSoTimeout() throws java.net.SocketException
- =
  public int getTrafficClass() throws java.net.SocketException
- =
  public boolean isBound()
- =
  public boolean isClosed()
- =
  public boolean isConnected()
- =
  public void joinGroup(java.net.SocketAddress arg0, java.net.NetworkInterface arg1) throws java.io.IOException
- =
  public void leaveGroup(java.net.SocketAddress arg0, java.net.NetworkInterface arg1) throws java.io.IOException
- =
  public void receive(java.net.DatagramPacket arg0) throws java.io.IOException
- =
  public void send(java.net.DatagramPacket arg0) throws java.io.IOException
- =
  public void setBroadcast(boolean arg0) throws java.net.SocketException
- =
  @Deprecated(since="17")
  public static void setDatagramSocketImplFactory(java.net.DatagramSocketImplFactory arg0) throws java.io.IOException
- =
  public <T> java.net.DatagramSocket setOption(java.net.SocketOption<T> arg0, T arg1) throws java.io.IOException
- =
  public void setReceiveBufferSize(int arg0) throws java.net.SocketException
- =
  public void setReuseAddress(boolean arg0) throws java.net.SocketException
- =
  public void setSendBufferSize(int arg0) throws java.net.SocketException
- =
  public void setSoTimeout(int arg0) throws java.net.SocketException
- =
  public void setTrafficClass(int arg0) throws java.net.SocketException
- =
  public java.util.Set<java.net.SocketOption<?>> supportedOptions()

## Summary

No differences.