Module java.base
Package java.net

# Class Socket

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

## Constructors

- =
  public Socket()
- =
  public Socket(java.lang.String arg0, int arg1) throws java.io.IOException, java.net.UnknownHostException
- =
  @Deprecated(forRemoval=truesince="1.1")
  public Socket(java.lang.String arg0, int arg1, boolean arg2) throws java.io.IOException
- =
  public Socket(java.lang.String arg0, int arg1, java.net.InetAddress arg2, int arg3) throws java.io.IOException
- =
  public Socket(java.net.InetAddress arg0, int arg1) throws java.io.IOException
- =
  @Deprecated(forRemoval=truesince="1.1")
  public Socket(java.net.InetAddress arg0, int arg1, boolean arg2) throws java.io.IOException
- =
  public Socket(java.net.InetAddress arg0, int arg1, java.net.InetAddress arg2, int arg3) throws java.io.IOException
- =
  public Socket(java.net.Proxy arg0)
- =
  protected Socket(java.net.SocketImpl arg0) throws java.net.SocketException

## Methods

- =
  public void bind(java.net.SocketAddress arg0) throws java.io.IOException
- =
  public void close() throws java.io.IOException
- =
  public void connect(java.net.SocketAddress arg0) throws java.io.IOException
- =
  public void connect(java.net.SocketAddress arg0, int arg1) throws java.io.IOException
- =
  public java.nio.channels.SocketChannel getChannel()
- =
  public java.net.InetAddress getInetAddress()
- =
  public java.io.InputStream getInputStream() throws java.io.IOException
- =
  public boolean getKeepAlive() throws java.net.SocketException
- =
  public java.net.InetAddress getLocalAddress()
- =
  public int getLocalPort()
- =
  public java.net.SocketAddress getLocalSocketAddress()
- =
  public boolean getOOBInline() throws java.net.SocketException
- =
  public <T> T getOption(java.net.SocketOption<T> arg0) throws java.io.IOException
- =
  public java.io.OutputStream getOutputStream() 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 getSoLinger() throws java.net.SocketException
- =
  public int getSoTimeout() throws java.net.SocketException
- =
  public boolean getTcpNoDelay() throws java.net.SocketException
- =
  public int getTrafficClass() throws java.net.SocketException
- =
  public boolean isBound()
- =
  public boolean isClosed()
- =
  public boolean isConnected()
- =
  public boolean isInputShutdown()
- =
  public boolean isOutputShutdown()
- =
  public void sendUrgentData(int arg0) throws java.io.IOException
- =
  public void setKeepAlive(boolean arg0) throws java.net.SocketException
- =
  public void setOOBInline(boolean arg0) throws java.net.SocketException
- =
  public <T> java.net.Socket setOption(java.net.SocketOption<T> arg0, T arg1) throws java.io.IOException
- =
  public void setPerformancePreferences(int arg0, int arg1, int arg2)
- =
  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 setSoLinger(boolean arg0, int arg1) throws java.net.SocketException
- =
  public void setSoTimeout(int arg0) throws java.net.SocketException
- =
  @Deprecated(since="17")
  public static void setSocketImplFactory(java.net.SocketImplFactory arg0) throws java.io.IOException
- =
  public void setTcpNoDelay(boolean arg0) throws java.net.SocketException
- =
  public void setTrafficClass(int arg0) throws java.net.SocketException
- =
  public void shutdownInput() throws java.io.IOException
- =
  public void shutdownOutput() throws java.io.IOException
- =
  public java.util.Set<java.net.SocketOption<?>> supportedOptions()
- =
  public java.lang.String toString()

## Summary

No differences.